diff options
author | Lars Knoll <lars.knoll@qt.io> | 2020-05-30 23:29:21 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2020-06-05 09:07:14 +0200 |
commit | c49728eb27be0f3f2eaaa77b0ed573f5d8705af1 (patch) | |
tree | 7115e967f463ab66c8df40dfd573cf5c8ddb8055 /qmake/generators | |
parent | 690abaac0e4bd57b5510e68730f7965c01a113da (diff) |
Port qmake from QStringRef to QStringView
Change-Id: Ie07a976cd3c634e04c8b9b1e0a6cacd4c2d94939
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/makefile.cpp | 20 | ||||
-rw-r--r-- | qmake/generators/makefile.h | 6 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 8 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.h | 4 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.h | 4 |
6 files changed, 23 insertions, 23 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index f27bb242a2..0fbfd0c9ef 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -857,29 +857,29 @@ MakefileGenerator::processPrlFile(QString &file, bool baseOnly) QString f = fileFixify(file, FileFixifyBackwards); // Explicitly given full .prl name if (!baseOnly && f.endsWith(Option::prl_ext)) - return processPrlFileCore(file, QStringRef(), f); + return processPrlFileCore(file, QStringView(), f); // Explicitly given or derived (from -l) base name - if (processPrlFileCore(file, QStringRef(), f + Option::prl_ext)) + if (processPrlFileCore(file, QStringView(), f + Option::prl_ext)) return true; if (!baseOnly) { // Explicitly given full library name int off = qMax(f.lastIndexOf('/'), f.lastIndexOf('\\')) + 1; - int ext = f.midRef(off).lastIndexOf('.'); + int ext = QStringView(f).mid(off).lastIndexOf('.'); if (ext != -1) - return processPrlFileBase(file, f.midRef(off), f.leftRef(off + ext), off); + return processPrlFileBase(file, QStringView(f).mid(off), QStringView{f}.left(off + ext), off); } return false; } bool -MakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int /*slashOff*/) +MakefileGenerator::processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int /*slashOff*/) { return processPrlFileCore(origFile, origName, fixedBase + Option::prl_ext); } bool -MakefileGenerator::processPrlFileCore(QString &origFile, const QStringRef &origName, +MakefileGenerator::processPrlFileCore(QString &origFile, QStringView origName, const QString &fixedFile) { const QString meta_file = QMakeMetaInfo::checkLib(fixedFile); @@ -1516,7 +1516,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources) int lastDirSepPosition = sourceRelativePath.lastIndexOf(Option::dir_sep); if (lastDirSepPosition != -1) - dir += sourceRelativePath.leftRef(lastDirSepPosition + 1); + dir += QStringView{sourceRelativePath}.left(lastDirSepPosition + 1); if (!noIO()) { // Ensure that the final output directory of each object exists @@ -1840,8 +1840,8 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString & int cut = file.indexOf('/'); if (cut < 0 || cut + 1 >= file.size()) continue; - QStringRef framework = file.leftRef(cut); - QStringRef include = file.midRef(cut + 1); + QStringView framework = QStringView{file}.left(cut); + QStringView include = QStringView(file).mid(cut + 1); if (local.endsWith('/' + framework + ".framework/Headers")) { lf = outDir.absoluteFilePath(local + '/' + include); if (exists(lf)) diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index b80b6e3e08..131da4943f 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -260,9 +260,9 @@ protected: QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst); - virtual bool processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff); - bool processPrlFileCore(QString &origFile, const QStringRef &origName, + virtual bool processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int slashOff); + bool processPrlFileCore(QString &origFile, QStringView origName, const QString &fixedFile); void createResponseFile(const QString &fileName, const ProStringList &objList); diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index e79e804266..432525ffba 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -64,13 +64,13 @@ MingwMakefileGenerator::parseLibFlag(const ProString &flag, ProString *arg) return MakefileGenerator::parseLibFlag(flag, arg); } -bool MingwMakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff) +bool MingwMakefileGenerator::processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int slashOff) { - if (origName.startsWith("lib")) { + if (origName.startsWith(u"lib")) { QString newFixedBase = fixedBase.left(slashOff) + fixedBase.mid(slashOff + 3); if (Win32MakefileGenerator::processPrlFileBase(origFile, origName, - QStringRef(&newFixedBase), slashOff)) { + QStringView(newFixedBase), slashOff)) { return true; } } diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index 6ab1c95a94..6c1f0086cc 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -39,8 +39,8 @@ protected: using MakefileGenerator::escapeDependencyPath; QString escapeDependencyPath(const QString &path) const override; ProString fixLibFlag(const ProString &lib) override; - bool processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff) override; + bool processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int slashOff) override; bool writeMakefile(QTextStream &) override; void init() override; QString installRoot() const override; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index a5d96483a8..0c32be8ef6 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -194,8 +194,8 @@ Win32MakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) return true; } -bool Win32MakefileGenerator::processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff) +bool Win32MakefileGenerator::processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int slashOff) { if (MakefileGenerator::processPrlFileBase(origFile, origName, fixedBase, slashOff)) return true; diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h index 265e54204e..180bd0fde8 100644 --- a/qmake/generators/win32/winmakefile.h +++ b/qmake/generators/win32/winmakefile.h @@ -56,8 +56,8 @@ protected: LibFlagType parseLibFlag(const ProString &flag, ProString *arg) override; ProString fixLibFlag(const ProString &lib) override; - bool processPrlFileBase(QString &origFile, const QStringRef &origName, - const QStringRef &fixedBase, int slashOff) override; + bool processPrlFileBase(QString &origFile, QStringView origName, + QStringView fixedBase, int slashOff) override; void processVars(); void fixTargetExt(); |