Use QStringList::join(QChar) overload where applicable [QtCore]
authorMarc Mutz <marc.mutz@kdab.com>
Fri, 18 May 2012 18:00:23 +0000 (20:00 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sun, 23 Sep 2012 21:30:18 +0000 (23:30 +0200)
This is an automated change performing the following replacements:
                    join\("(.)"\) -> join('\1')
  join\(QLatin1String\("(.)"\)\)  -> join(QLatin1Char('\1'))
  join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1'))

Change-Id: I81c378ef6aeeada5e116f1394cc9fc67f901ffd6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
src/corelib/io/qdir.cpp
src/corelib/io/qiodevice.cpp
src/corelib/io/qsettings_mac.cpp
tests/auto/corelib/mimetypes/qmimedatabase/tst_qmimedatabase.cpp
tests/auto/corelib/tools/qsharedpointer/externaltests.cpp

index dd3c10d..5463ada 100644 (file)
@@ -2255,7 +2255,7 @@ QDebug operator<<(QDebug debug, QDir::Filters filters)
         if (filters & QDir::System) flags << QLatin1String("System");
         if (filters & QDir::CaseSensitive) flags << QLatin1String("CaseSensitive");
     }
-    debug << "QDir::Filters(" << qPrintable(flags.join(QLatin1String("|"))) << ')';
+    debug << "QDir::Filters(" << qPrintable(flags.join(QLatin1Char('|'))) << ')';
     return debug;
 }
 
@@ -2278,7 +2278,7 @@ static QDebug operator<<(QDebug debug, QDir::SortFlags sorting)
         if (sorting & QDir::Type) flags << QLatin1String("Type");
         debug << "QDir::SortFlags(" << qPrintable(type)
               << '|'
-              << qPrintable(flags.join(QLatin1String("|"))) << ')';
+              << qPrintable(flags.join(QLatin1Char('|'))) << ')';
     }
     return debug;
 }
@@ -2287,7 +2287,7 @@ QDebug operator<<(QDebug debug, const QDir &dir)
 {
     debug.maybeSpace() << "QDir(" << dir.path()
                        << ", nameFilters = {"
-                       << qPrintable(dir.nameFilters().join(QLatin1String(",")))
+                       << qPrintable(dir.nameFilters().join(QLatin1Char(',')))
                        << "}, "
                        << dir.sorting()
                        << ','
index aee240b..6901bff 100644 (file)
@@ -1687,7 +1687,7 @@ QDebug operator<<(QDebug debug, QIODevice::OpenMode modes)
             modeList << QLatin1String("Unbuffered");
     }
     qSort(modeList);
-    debug << modeList.join(QLatin1String("|"));
+    debug << modeList.join(QLatin1Char('|'));
     debug << ')';
     return debug;
 }
index 8957b1b..4f6902d 100644 (file)
@@ -399,7 +399,7 @@ QMacSettingsPrivate::QMacSettingsPrivate(QSettings::Scope scope, const QString &
                     const QString &bundle_identifier_component = bundle_identifier_components.at(i);
                     bundle_identifier_components_reversed.push_front(bundle_identifier_component);
                 }
-                domainName = bundle_identifier_components_reversed.join(QLatin1String("."));
+                domainName = bundle_identifier_components_reversed.join(QLatin1Char('.'));
             }
         }
     }
index f71ff32..b731eaf 100644 (file)
@@ -581,7 +581,7 @@ void tst_QMimeDatabase::suffixes()
     expectedPatterns.sort();
     QStringList mimePatterns = mime.globPatterns();
     mimePatterns.sort();
-    QCOMPARE(mimePatterns.join(QLatin1String(";")), expectedPatterns.join(QLatin1String(";")));
+    QCOMPARE(mimePatterns.join(QLatin1Char(';')), expectedPatterns.join(QLatin1Char(';')));
     QCOMPARE(mime.preferredSuffix(), preferredSuffix);
 }
 
index c6a068d..c229441 100644 (file)
@@ -488,7 +488,7 @@ namespace QTest {
             projectFile.write("\nCONFIG  += release\n");
 #endif
 
-        QByteArray extraSources = QFile::encodeName(extraProgramSources.join(" "));
+        QByteArray extraSources = QFile::encodeName(extraProgramSources.join(' '));
         if (!extraSources.isEmpty()) {
             projectFile.write("SOURCES  += ");
             projectFile.write(extraSources);