diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2020-02-25 17:18:29 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2020-02-28 15:37:11 +0100 |
commit | 00f0863cbe7236742403a591b6409e480402cddf (patch) | |
tree | 3a3d29b0a20a3e31ad0cb56a1109005c2ced2ad2 /src/corelib/io | |
parent | 8c613ed74bf37573ca6c2d93e5bb77e0695ba953 (diff) |
Core: Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.
Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qdir.cpp | 4 | ||||
-rw-r--r-- | src/corelib/io/qfileselector.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemiterator_win.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qsettings_winrt.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths.cpp | 3 | ||||
-rw-r--r-- | src/corelib/io/qstandardpaths_unix.cpp | 2 | ||||
-rw-r--r-- | src/corelib/io/qtldurl.cpp | 2 |
8 files changed, 10 insertions, 9 deletions
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 526702d151..5ce3fbcca8 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -867,8 +867,8 @@ QString QDir::relativeFilePath(const QString &fileName) const #endif QString result; - QVector<QStringRef> dirElts = dir.splitRef(QLatin1Char('/'), QString::SkipEmptyParts); - QVector<QStringRef> fileElts = file.splitRef(QLatin1Char('/'), QString::SkipEmptyParts); + QVector<QStringRef> dirElts = dir.splitRef(QLatin1Char('/'), Qt::SkipEmptyParts); + QVector<QStringRef> fileElts = file.splitRef(QLatin1Char('/'), Qt::SkipEmptyParts); int i = 0; while (i < dirElts.size() && i < fileElts.size() && diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index 31c490de66..ee378f6434 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -324,7 +324,7 @@ void QFileSelectorPrivate::updateSelectors() QLatin1Char pathSep(','); QStringList envSelectors = QString::fromLatin1(qgetenv("QT_FILE_SELECTORS")) - .split(pathSep, QString::SkipEmptyParts); + .split(pathSep, Qt::SkipEmptyParts); if (envSelectors.count()) sharedData->staticSelectors << envSelectors; diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 36d43e9cb7..6ad123f3b6 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -394,7 +394,7 @@ static QString readLink(const QFileSystemEntry &link) static bool uncShareExists(const QString &server) { // This code assumes the UNC path is always like \\?\UNC\server... - const QVector<QStringRef> parts = server.splitRef(QLatin1Char('\\'), QString::SkipEmptyParts); + const QVector<QStringRef> parts = server.splitRef(QLatin1Char('\\'), Qt::SkipEmptyParts); if (parts.count() >= 3) { QStringList shares; if (QFileSystemEngine::uncListSharesOnServer(QLatin1String("\\\\") + parts.at(2), &shares)) diff --git a/src/corelib/io/qfilesystemiterator_win.cpp b/src/corelib/io/qfilesystemiterator_win.cpp index 6741282881..a2a4271ba9 100644 --- a/src/corelib/io/qfilesystemiterator_win.cpp +++ b/src/corelib/io/qfilesystemiterator_win.cpp @@ -101,7 +101,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa FINDEX_SEARCH_OPS(searchOps), 0, dwAdditionalFlags); if (findFileHandle == INVALID_HANDLE_VALUE) { if (nativePath.startsWith(QLatin1String("\\\\?\\UNC\\"))) { - const QVector<QStringRef> parts = nativePath.splitRef(QLatin1Char('\\'), QString::SkipEmptyParts); + const QVector<QStringRef> parts = nativePath.splitRef(QLatin1Char('\\'), Qt::SkipEmptyParts); if (parts.count() == 4 && QFileSystemEngine::uncListSharesOnServer( QLatin1String("\\\\") + parts.at(2), &uncShares)) { if (uncShares.isEmpty()) diff --git a/src/corelib/io/qsettings_winrt.cpp b/src/corelib/io/qsettings_winrt.cpp index e91d4d64a2..a208262ab4 100644 --- a/src/corelib/io/qsettings_winrt.cpp +++ b/src/corelib/io/qsettings_winrt.cpp @@ -646,7 +646,7 @@ IApplicationDataContainer *QWinRTSettingsPrivate::getContainer(IApplicationDataC IApplicationDataContainer *current = parent; if (group.isEmpty()) return current; - const QStringList groupPath = group.split(QLatin1Char('/'), QString::SkipEmptyParts); + const QStringList groupPath = group.split(QLatin1Char('/'), Qt::SkipEmptyParts); for (const QString &subGroup : groupPath) { ComPtr<IApplicationDataContainer> sub = subContainer(current, subGroup); diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index b56cf00308..04aff3d11b 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -510,7 +510,8 @@ QString QStandardPaths::findExecutable(const QString &executableName, const QStr } // Remove trailing slashes, which occur on Windows. - const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split(QDir::listSeparator(), QString::SkipEmptyParts); + const QStringList rawPaths = QString::fromLocal8Bit(pEnv.constData()).split( + QDir::listSeparator(), Qt::SkipEmptyParts); searchPaths.reserve(rawPaths.size()); for (const QString &rawPath : rawPaths) { QString cleanPath = QDir::cleanPath(rawPath); diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index 5f4955c53f..ec37ce7d76 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -283,7 +283,7 @@ static QStringList xdgDataDirs() dirs.append(QString::fromLatin1("/usr/local/share")); dirs.append(QString::fromLatin1("/usr/share")); } else { - const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), QString::SkipEmptyParts); + const auto parts = xdgDataDirsEnv.splitRef(QLatin1Char(':'), Qt::SkipEmptyParts); // Normalize paths, skip relative paths for (const QStringRef &dir : parts) { diff --git a/src/corelib/io/qtldurl.cpp b/src/corelib/io/qtldurl.cpp index fc3e16b241..3301a76011 100644 --- a/src/corelib/io/qtldurl.cpp +++ b/src/corelib/io/qtldurl.cpp @@ -95,7 +95,7 @@ static bool containsTLDEntry(QStringView entry, TLDMatchType match) Q_CORE_EXPORT QString qTopLevelDomain(const QString &domain) { const QString domainLower = domain.toLower(); - QVector<QStringRef> sections = domainLower.splitRef(QLatin1Char('.'), QString::SkipEmptyParts); + QVector<QStringRef> sections = domainLower.splitRef(QLatin1Char('.'), Qt::SkipEmptyParts); if (sections.isEmpty()) return QString(); |