diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-03-13 22:59:43 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-03-23 09:10:03 +0000 |
commit | 99c4243d04df2c543a3ea5c66d2e37ed7ac5e081 (patch) | |
tree | 2de5273b24857496dc1d31022dae674e7ea5252a | |
parent | 919d07e6809a6705941a9819ba145062a947fa39 (diff) | |
download | qttools-99c4243d04df2c543a3ea5c66d2e37ed7ac5e081.tar.gz |
Use join(QChar), join(QLatin1String) where applicable
They're faster/expand to less code.
Change-Id: I4d79abb870c7b49784be17dc174ab68d98b1a75d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r-- | src/designer/src/components/formeditor/formwindowsettings.cpp | 2 | ||||
-rw-r--r-- | src/designer/src/components/propertyeditor/designerpropertymanager.cpp | 2 | ||||
-rw-r--r-- | src/designer/src/designer/qdesigner_actions.cpp | 2 | ||||
-rw-r--r-- | src/linguist/linguist/mainwindow.cpp | 4 | ||||
-rw-r--r-- | src/linguist/lupdate/main.cpp | 2 | ||||
-rw-r--r-- | src/linguist/shared/po.cpp | 2 | ||||
-rw-r--r-- | src/linguist/shared/qph.cpp | 2 | ||||
-rw-r--r-- | src/linguist/shared/translator.h | 2 | ||||
-rw-r--r-- | src/linguist/shared/ts.cpp | 2 | ||||
-rw-r--r-- | src/linguist/shared/xliff.cpp | 2 | ||||
-rw-r--r-- | src/macdeployqt/shared/shared.cpp | 8 | ||||
-rw-r--r-- | src/qdoc/cppcodeparser.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/qdocindexfiles.cpp | 2 | ||||
-rw-r--r-- | src/qdoc/tree.cpp | 2 |
14 files changed, 18 insertions, 18 deletions
diff --git a/src/designer/src/components/formeditor/formwindowsettings.cpp b/src/designer/src/components/formeditor/formwindowsettings.cpp index 3b82d0b86..ac14eb0bf 100644 --- a/src/designer/src/components/formeditor/formwindowsettings.cpp +++ b/src/designer/src/components/formeditor/formwindowsettings.cpp @@ -236,7 +236,7 @@ void FormWindowSettings::setData(const FormWindowData &data) if (data.includeHints.empty()) { m_ui->includeHintsTextEdit->clear(); } else { - m_ui->includeHintsTextEdit->setText(data.includeHints.join(QStringLiteral("\n"))); + m_ui->includeHintsTextEdit->setText(data.includeHints.join(QLatin1Char('\n'))); } m_ui->gridPanel->setChecked(data.hasFormGrid); diff --git a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp index f4b1f5cfd..9730dff64 100644 --- a/src/designer/src/components/propertyeditor/designerpropertymanager.cpp +++ b/src/designer/src/components/propertyeditor/designerpropertymanager.cpp @@ -1543,7 +1543,7 @@ QString DesignerPropertyManager::valueText(const QtProperty *property) const if (vType == QVariant::StringList || vType == designerStringListTypeId()) { QVariant v = value(property); const QStringList list = v.type() == QVariant::StringList ? v.toStringList() : qvariant_cast<PropertySheetStringListValue>(v).value(); - return list.join(QStringLiteral("; ")); + return list.join(QLatin1String("; ")); } if (vType == designerKeySequenceTypeId()) { return qvariant_cast<PropertySheetKeySequenceValue>(value(property)).value().toString(QKeySequence::NativeText); diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 34ee1b0ab..b7707f541 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -841,7 +841,7 @@ bool QDesignerActions::writeOutForm(QDesignerFormWindowInterface *fw, const QStr if (check) { const QStringList problems = fw->checkContents(); if (!problems.isEmpty()) - QMessageBox::information(fw->window(), tr("Qt Designer"), problems.join(QStringLiteral("<br>"))); + QMessageBox::information(fw->window(), tr("Qt Designer"), problems.join(QLatin1String("<br>"))); } QString contents = fw->contents(); diff --git a/src/linguist/linguist/mainwindow.cpp b/src/linguist/linguist/mainwindow.cpp index 4c3760290..4f69cf882 100644 --- a/src/linguist/linguist/mainwindow.cpp +++ b/src/linguist/linguist/mainwindow.cpp @@ -769,7 +769,7 @@ static QString fileFilters(bool allFirst) allExtensions.append(QLatin1String("*.") + format.extension); } } - QString allFilter = QObject::tr("Translation files (%1);;").arg(allExtensions.join(QLatin1String(" "))); + QString allFilter = QObject::tr("Translation files (%1);;").arg(allExtensions.join(QLatin1Char(' '))); if (allFirst) filter.prepend(allFilter); else @@ -932,7 +932,7 @@ void MainWindow::print() } if (m->message().isPlural() && m_dataModel->language(k) != QLocale::C) { QStringList transls = m->translations(); - pout.addBox(40, transls.join(QLatin1String("\n"))); + pout.addBox(40, transls.join(QLatin1Char('\n'))); } else { pout.addBox(40, m->translation()); } diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index 4c8f5a9dc..6a3043627 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -229,7 +229,7 @@ static void printUsage() " line, and prefixed with -I) from lst-file.\n" ).arg(m_defaultExtensions, trFunctionAliasManager.availableFunctionsWithAliases() - .join(QStringLiteral("\n ")))); + .join(QLatin1String("\n ")))); } static bool handleTrFunctionAliases(const QString &arg) diff --git a/src/linguist/shared/po.cpp b/src/linguist/shared/po.cpp index ed6320de1..a998aa0f6 100644 --- a/src/linguist/shared/po.cpp +++ b/src/linguist/shared/po.cpp @@ -792,7 +792,7 @@ bool savePO(const Translator &translator, QIODevice &dev, ConversionData &) .arg(ref.lineNumber()).arg(ref.fileName())); if (!xrefs.isEmpty()) refs << xrefs; - out << poWrappedEscapedLines(QLatin1String("#:"), true, refs.join(QLatin1String(" "))); + out << poWrappedEscapedLines(QLatin1String("#:"), true, refs.join(QLatin1Char(' '))); } bool noWrap = false; diff --git a/src/linguist/shared/qph.cpp b/src/linguist/shared/qph.cpp index da5d20e2a..9bfd8833d 100644 --- a/src/linguist/shared/qph.cpp +++ b/src/linguist/shared/qph.cpp @@ -160,7 +160,7 @@ static bool saveQPH(const Translator &translator, QIODevice &dev, ConversionData foreach (const TranslatorMessage &msg, translator.messages()) { t << "<phrase>\n"; t << " <source>" << protect(msg.sourceText()) << "</source>\n"; - QString str = msg.translations().join(QLatin1String("@")); + QString str = msg.translations().join(QLatin1Char('@')); str.replace(QChar(Translator::BinaryVariantSeparator), QChar(Translator::TextVariantSeparator)); t << " <target>" << protect(str) diff --git a/src/linguist/shared/translator.h b/src/linguist/shared/translator.h index ff6bd9578..57a154008 100644 --- a/src/linguist/shared/translator.h +++ b/src/linguist/shared/translator.h @@ -70,7 +70,7 @@ public: bool sortContexts() const { return m_sortContexts; } void appendError(const QString &error) { m_errors.append(error); } - QString error() const { return m_errors.isEmpty() ? QString() : m_errors.join(QLatin1String("\n")) + QLatin1Char('\n'); } + QString error() const { return m_errors.isEmpty() ? QString() : m_errors.join(QLatin1Char('\n')) + QLatin1Char('\n'); } QStringList errors() const { return m_errors; } void clearErrors() { m_errors.clear(); } diff --git a/src/linguist/shared/ts.cpp b/src/linguist/shared/ts.cpp index 19eb2d0ec..ee75fc277 100644 --- a/src/linguist/shared/ts.cpp +++ b/src/linguist/shared/ts.cpp @@ -542,7 +542,7 @@ bool saveTS(const Translator &translator, QIODevice &dev, ConversionData &cd) t << "</dependencies>\n"; } - QRegExp drops(cd.dropTags().join(QLatin1String("|"))); + QRegExp drops(cd.dropTags().join(QLatin1Char('|'))); writeExtras(t, " ", translator.extras(), drops); diff --git a/src/linguist/shared/xliff.cpp b/src/linguist/shared/xliff.cpp index 5f918218b..338768875 100644 --- a/src/linguist/shared/xliff.cpp +++ b/src/linguist/shared/xliff.cpp @@ -760,7 +760,7 @@ bool saveXLIFF(const Translator &translator, QIODevice &dev, ConversionData &cd) QStringList dtgs = cd.dropTags(); dtgs << QLatin1String("po-(old_)?msgid_plural"); - QRegExp drops(dtgs.join(QLatin1String("|"))); + QRegExp drops(dtgs.join(QLatin1Char('|'))); QHash<QString, QHash<QString, QList<TranslatorMessage> > > messageOrder; QHash<QString, QList<QString> > contextOrder; diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp index e57bc785d..da69b1e38 100644 --- a/src/macdeployqt/shared/shared.cpp +++ b/src/macdeployqt/shared/shared.cpp @@ -297,15 +297,15 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl foreach (QString path, librarySearchPath) { if (!path.endsWith("/")) path += '/'; - QString nameInPath = path + parts.join("/"); + QString nameInPath = path + parts.join(QLatin1Char('/')); if (QFile::exists(nameInPath)) { - info.frameworkDirectory = path + partsCopy.join("/"); + info.frameworkDirectory = path + partsCopy.join(QLatin1Char('/')); break; } } if (currentPart.contains(".framework")) { if (info.frameworkDirectory.isEmpty()) - info.frameworkDirectory = "/Library/Frameworks/" + partsCopy.join("/"); + info.frameworkDirectory = "/Library/Frameworks/" + partsCopy.join(QLatin1Char('/')); if (!info.frameworkDirectory.endsWith("/")) info.frameworkDirectory += "/"; state = FrameworkName; @@ -313,7 +313,7 @@ FrameworkInfo parseOtoolLibraryLine(const QString &line, const QString &appBundl continue; } else if (currentPart.contains(".dylib")) { if (info.frameworkDirectory.isEmpty()) - info.frameworkDirectory = "/usr/lib/" + partsCopy.join("/"); + info.frameworkDirectory = "/usr/lib/" + partsCopy.join(QLatin1Char('/')); if (!info.frameworkDirectory.endsWith("/")) info.frameworkDirectory += "/"; state = DylibName; diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp index 740216b1f..b67520600 100644 --- a/src/qdoc/cppcodeparser.cpp +++ b/src/qdoc/cppcodeparser.cpp @@ -436,7 +436,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc, if ((type == Node::Class) || (type == Node::Namespace)) { if (path.size() > 1) { path.pop_back(); - QString ns = path.join("::"); + QString ns = path.join(QLatin1String("::")); qdb_->insertOpenNamespace(ns); } } diff --git a/src/qdoc/qdocindexfiles.cpp b/src/qdoc/qdocindexfiles.cpp index d5fa06c67..4918fe795 100644 --- a/src/qdoc/qdocindexfiles.cpp +++ b/src/qdoc/qdocindexfiles.cpp @@ -1202,7 +1202,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer, associatedProperties << pn->name(); } associatedProperties.sort(); - writer.writeAttribute("associated-property", associatedProperties.join(",")); + writer.writeAttribute("associated-property", associatedProperties.join(QLatin1Char(','))); } writer.writeAttribute("type", functionNode->returnType()); if (!brief.isEmpty()) diff --git a/src/qdoc/tree.cpp b/src/qdoc/tree.cpp index 568d17859..adc9f75b2 100644 --- a/src/qdoc/tree.cpp +++ b/src/qdoc/tree.cpp @@ -729,7 +729,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path, } } - node = findUnambiguousTarget(path.join(QStringLiteral("::")), genus, ref); + node = findUnambiguousTarget(path.join(QLatin1String("::")), genus, ref); if (node) { if (!target.isEmpty()) { ref = getRef(target, node); |