forked from qt-creator/qt-creator
Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -303,7 +303,7 @@ void CompletionContextFinder::checkImport()
|
||||
|
||||
YY_RESTORE();
|
||||
if (m_inImport && isInLibVersionImport == 1) {
|
||||
m_libVersion = libVersionImport.join(QLatin1String(""));
|
||||
m_libVersion = libVersionImport.join(QString());
|
||||
if (m_libVersion.isNull())
|
||||
m_libVersion = QLatin1String("");
|
||||
} else {
|
||||
|
||||
@@ -481,10 +481,10 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
|
||||
--iPath;
|
||||
if (safeName.indexIn(myPath.at(iPath)) != 0)
|
||||
break;
|
||||
ImportKey iKey(ImportType::Library, QStringList(myPath.mid(iPath)).join(QLatin1String(".")),
|
||||
ImportKey iKey(ImportType::Library, QStringList(myPath.mid(iPath)).join(QLatin1Char('.')),
|
||||
importKey.majorVersion, importKey.minorVersion);
|
||||
cImport.possibleExports.append(Export(iKey, (iPath == 1) ? QLatin1String("/") :
|
||||
QStringList(myPath.mid(0, iPath)).join(QLatin1String("/")), true));
|
||||
QStringList(myPath.mid(0, iPath)).join(QLatin1Char('/')), true));
|
||||
}
|
||||
} else {
|
||||
QString requiredPath = QStringList(splitPath.mid(0, splitPath.size() - importKey.splitPath.size()))
|
||||
@@ -512,10 +512,10 @@ void Snapshot::insertLibraryInfo(const QString &path, const LibraryInfo &info)
|
||||
--iPath;
|
||||
if (safeName.indexIn(splitPath.at(iPath)) != 0)
|
||||
break;
|
||||
ImportKey iKey(ImportType::Library, QStringList(splitPath.mid(iPath)).join(QLatin1String(".")),
|
||||
ImportKey iKey(ImportType::Library, QStringList(splitPath.mid(iPath)).join(QLatin1Char('.')),
|
||||
majorVersion, minorVersion);
|
||||
cImport.possibleExports.append(Export(iKey, (iPath == 1) ? QLatin1String("/") :
|
||||
QStringList(splitPath.mid(0, iPath)).join(QLatin1String("/")), true));
|
||||
QStringList(splitPath.mid(0, iPath)).join(QLatin1Char('/')), true));
|
||||
}
|
||||
}
|
||||
foreach (const QmlDirParser::Component &component, info.components()) {
|
||||
|
||||
@@ -200,7 +200,7 @@ ImportKey ImportKey::flatKey() const {
|
||||
|
||||
QString ImportKey::libraryQualifiedPath() const
|
||||
{
|
||||
QString res = splitPath.join(QString::fromLatin1("."));
|
||||
QString res = splitPath.join(QLatin1Char('.'));
|
||||
if (res.isEmpty() && !splitPath.isEmpty())
|
||||
return QLatin1String("");
|
||||
return res;
|
||||
@@ -208,7 +208,7 @@ QString ImportKey::libraryQualifiedPath() const
|
||||
|
||||
QString ImportKey::path() const
|
||||
{
|
||||
QString res = splitPath.join(QString::fromLatin1("/"));
|
||||
QString res = splitPath.join(QLatin1Char('/'));
|
||||
if (res.isEmpty() && !splitPath.isEmpty())
|
||||
return QLatin1String("/");
|
||||
return res;
|
||||
@@ -442,7 +442,7 @@ QString ImportKey::toString() const
|
||||
res = path();
|
||||
break;
|
||||
case ImportType::Library:
|
||||
res = splitPath.join(QLatin1String("."));
|
||||
res = splitPath.join(QLatin1Char('.'));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -431,7 +431,7 @@ Import LinkPrivate::importNonFile(Document::Ptr doc, const ImportInfo &importInf
|
||||
"%1\n\n"
|
||||
"For qmake projects, use the QML_IMPORT_PATH variable to add import paths.\n"
|
||||
"For qmlproject projects, use the importPaths property to add import paths.").arg(
|
||||
importPaths.join(QLatin1String("\n"))));
|
||||
importPaths.join(QLatin1Char('\n'))));
|
||||
}
|
||||
|
||||
return import;
|
||||
|
||||
@@ -241,7 +241,7 @@ static QString qmldumpErrorMessage(const QString &libraryPath, const QString &er
|
||||
static QString qmldumpFailedMessage(const QString &libraryPath, const QString &error)
|
||||
{
|
||||
QString firstLines =
|
||||
QStringList(error.split(QLatin1Char('\n')).mid(0, 10)).join(QLatin1String("\n"));
|
||||
QStringList(error.split(QLatin1Char('\n')).mid(0, 10)).join(QLatin1Char('\n'));
|
||||
return noTypeinfoError(libraryPath) + QLatin1String("\n\n") +
|
||||
PluginDumper::tr("Automatic type dump of QML module failed.\n"
|
||||
"First 10 lines or errors:\n"
|
||||
@@ -412,9 +412,9 @@ void PluginDumper::loadQmltypesFile(const QStringList &qmltypesFilePaths,
|
||||
if (errors.isEmpty()) {
|
||||
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileDone);
|
||||
} else {
|
||||
printParseWarnings(libraryPath, errors.join(QLatin1String("\n")));
|
||||
printParseWarnings(libraryPath, errors.join(QLatin1Char('\n')));
|
||||
errors.prepend(tr("Errors while reading typeinfo files:"));
|
||||
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileError, errors.join(QLatin1String("\n")));
|
||||
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::TypeInfoFileError, errors.join(QLatin1Char('\n')));
|
||||
}
|
||||
|
||||
if (!warnings.isEmpty())
|
||||
|
||||
@@ -301,7 +301,7 @@ protected:
|
||||
continue;
|
||||
|
||||
// the extra space is to avoid // comments sticking to the 0 offset
|
||||
QString indentLine = newContext.join(QLatin1String("\n")) + QLatin1String("\n ") + restLine;
|
||||
QString indentLine = newContext.join(QLatin1Char('\n')) + QLatin1String("\n ") + restLine;
|
||||
int indent = tryIndent(indentLine);
|
||||
|
||||
QList<Split> newSplits = possibleSplits.mid(i + 1);
|
||||
|
||||
Reference in New Issue
Block a user