summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-27 12:15:19 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-12 15:51:11 +0200
commit413a9f9bde60af2633c858435436891c8511385b (patch)
tree0161904d587c6da62da52706c4cc9f3ad779433f /src/corelib/plugin
parentd6b74761342bd3cc317ba5cfbca138be087fea2e (diff)
Port remaining usages of QStringRef in QtCore to QStringView
Task-number: QTBUG-84319 Change-Id: If77bc94c18e8d522b4577050091cd7d7aa941311 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qlibrary.cpp6
-rw-r--r--src/corelib/plugin/qpluginloader.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index e512ff2c32..b66eb3e993 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -667,7 +667,7 @@ bool QLibrary::isLibrary(const QString &fileName)
QString completeSuffix = QFileInfo(fileName).completeSuffix();
if (completeSuffix.isEmpty())
return false;
- const QVector<QStringRef> suffixes = completeSuffix.splitRef(QLatin1Char('.'));
+ const auto suffixes = QStringView{completeSuffix}.split(QLatin1Char('.'));
QStringList validSuffixList;
# if defined(Q_OS_HPUX)
@@ -702,12 +702,12 @@ bool QLibrary::isLibrary(const QString &fileName)
int suffix;
int suffixPos = -1;
for (suffix = 0; suffix < validSuffixList.count() && suffixPos == -1; ++suffix)
- suffixPos = suffixes.indexOf(QStringRef(&validSuffixList.at(suffix)));
+ suffixPos = suffixes.indexOf(validSuffixList.at(suffix));
bool valid = suffixPos != -1;
for (int i = suffixPos + 1; i < suffixes.count() && valid; ++i)
if (i != suffixPos)
- suffixes.at(i).toInt(&valid);
+ (void)suffixes.at(i).toInt(&valid);
return valid;
#endif
}
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 0a63b93762..2ae6913868 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -293,8 +293,8 @@ static QString locatePlugin(const QString& fileName)
// Split up "subdir/filename"
const int slash = fileName.lastIndexOf(QLatin1Char('/'));
- const QStringRef baseName = fileName.midRef(slash + 1);
- const QStringRef basePath = isAbsolute ? QStringRef() : fileName.leftRef(slash + 1); // keep the '/'
+ const auto baseName = QStringView{fileName}.mid(slash + 1);
+ const auto basePath = isAbsolute ? QStringView() : QStringView{fileName}.left(slash + 1); // keep the '/'
const bool debug = qt_debug_component();