diff options
author | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-03-21 13:16:05 +0100 |
---|---|---|
committer | Sona Kurazyan <sona.kurazyan@qt.io> | 2022-04-20 10:45:10 +0200 |
commit | 2ee67a6709b9f829c5ec36b8f3e69d415f696cec (patch) | |
tree | 85844a2bb8d091dbbce5309680f0809f16ef48ed /src | |
parent | 7b2aade5ca4798e180aca7daf9033351b37653e5 (diff) | |
download | qttools-2ee67a6709b9f829c5ec36b8f3e69d415f696cec.tar.gz |
Replace uses of deprecated _qs with _s
Task-number: QTBUG-101408
Change-Id: If6f25418bf3af66ad9bde2dba8bf529b8d202f83
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/designer/src/designer/qdesigner.cpp | 4 | ||||
-rw-r--r-- | src/designer/src/designer/qdesigner_actions.cpp | 5 | ||||
-rw-r--r-- | src/designer/src/lib/sdk/abstractintegration.cpp | 4 | ||||
-rw-r--r-- | src/designer/src/lib/shared/pluginmanager.cpp | 6 | ||||
-rw-r--r-- | src/designer/src/lib/shared/qdesigner_utils.cpp | 6 | ||||
-rw-r--r-- | src/designer/src/lib/shared/shared_settings.cpp | 4 | ||||
-rw-r--r-- | src/linguist/linguist/printout.cpp | 4 | ||||
-rw-r--r-- | src/linguist/lprodump/main.cpp | 14 | ||||
-rw-r--r-- | src/linguist/lrelease-pro/main.cpp | 6 | ||||
-rw-r--r-- | src/linguist/lrelease/main.cpp | 4 | ||||
-rw-r--r-- | src/linguist/lupdate-pro/main.cpp | 10 | ||||
-rw-r--r-- | src/linguist/lupdate/cpp_clang.cpp | 4 | ||||
-rw-r--r-- | src/linguist/lupdate/main.cpp | 36 | ||||
-rw-r--r-- | src/linguist/lupdate/ui.cpp | 4 | ||||
-rw-r--r-- | src/pixeltool/qpixeltool.cpp | 4 | ||||
-rw-r--r-- | src/qdoc/doc.cpp | 6 | ||||
-rw-r--r-- | src/qdoc/tokenizer.h | 6 |
17 files changed, 80 insertions, 47 deletions
diff --git a/src/designer/src/designer/qdesigner.cpp b/src/designer/src/designer/qdesigner.cpp index b0f2d5d83..777b08a2b 100644 --- a/src/designer/src/designer/qdesigner.cpp +++ b/src/designer/src/designer/qdesigner.cpp @@ -56,6 +56,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static const char *designerApplicationName = "Designer"; static const char designerDisplayName[] = "Qt Designer"; static const char *designerWarningPrefix = "Designer: "; @@ -203,7 +205,7 @@ static inline QDesigner::ParseArgumentsResult return QDesigner::ParseArgumentsHelpRequested; // There is no way to retrieve the complete help text from QCommandLineParser, // so, call process() to display it. - if (parser.isSet(u"help-all"_qs)) + if (parser.isSet(u"help-all"_s)) parser.process(QCoreApplication::arguments()); // exits options->server = parser.isSet(serverOption); if (parser.isSet(clientOption)) { diff --git a/src/designer/src/designer/qdesigner_actions.cpp b/src/designer/src/designer/qdesigner_actions.cpp index 4f9e64e2e..88ab7c343 100644 --- a/src/designer/src/designer/qdesigner_actions.cpp +++ b/src/designer/src/designer/qdesigner_actions.cpp @@ -104,6 +104,7 @@ QT_BEGIN_NAMESPACE using namespace qdesigner_internal; +using namespace Qt::StringLiterals; const char *QDesignerActions::defaultToolbarPropertyName = "__qt_defaultToolBarAction"; @@ -1188,8 +1189,8 @@ bool QDesignerActions::ensureBackupDirectories() { if (m_backupPath.isEmpty()) { // create names - m_backupPath = dataDirectory() + u"/backup"_qs; - m_backupTmpPath = m_backupPath + u"/tmp"_qs; + m_backupPath = dataDirectory() + u"/backup"_s; + m_backupTmpPath = m_backupPath + u"/tmp"_s; } // ensure directories diff --git a/src/designer/src/lib/sdk/abstractintegration.cpp b/src/designer/src/lib/sdk/abstractintegration.cpp index aca3511d2..86c16231e 100644 --- a/src/designer/src/lib/sdk/abstractintegration.cpp +++ b/src/designer/src/lib/sdk/abstractintegration.cpp @@ -60,6 +60,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + /*! \class QDesignerIntegrationInterface @@ -360,7 +362,7 @@ void QDesignerIntegrationPrivate::initialize() m_gradientManager = new QtGradientManager(q); core->setGradientManager(m_gradientManager); - const QString gradientsFile = u"/gradients.xml"_qs; + const QString gradientsFile = u"/gradients.xml"_s; m_gradientsPath = dataDirectory() + gradientsFile; // Migrate from legacy to standard data directory in Qt 7 diff --git a/src/designer/src/lib/shared/pluginmanager.cpp b/src/designer/src/lib/shared/pluginmanager.cpp index 6c39f8e88..3a92bce9d 100644 --- a/src/designer/src/lib/shared/pluginmanager.cpp +++ b/src/designer/src/lib/shared/pluginmanager.cpp @@ -50,6 +50,8 @@ #include <QtCore/qxmlstream.h> +using namespace Qt::StringLiterals; + static const char *uiElementC = "ui"; static const char *languageAttributeC = "language"; static const char *widgetElementC = "widget"; @@ -99,9 +101,9 @@ QStringList QDesignerPluginManager::defaultPluginPaths() const QStringList path_list = QCoreApplication::libraryPaths(); for (const QString &path : path_list) - result.append(path + u"/designer"_qs); + result.append(path + u"/designer"_s); - result.append(qdesigner_internal::dataDirectory() + u"/plugins"_qs); + result.append(qdesigner_internal::dataDirectory() + u"/plugins"_s); return result; } diff --git a/src/designer/src/lib/shared/qdesigner_utils.cpp b/src/designer/src/lib/shared/qdesigner_utils.cpp index 7b6882391..2c54dde82 100644 --- a/src/designer/src/lib/shared/qdesigner_utils.cpp +++ b/src/designer/src/lib/shared/qdesigner_utils.cpp @@ -56,19 +56,21 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + namespace qdesigner_internal { // ### FIXME Qt 8: Remove (QTBUG-96005) QString legacyDataDirectory() { - return QDir::homePath() + u"/.designer"_qs; + return QDir::homePath() + u"/.designer"_s; } QString dataDirectory() { #if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) return QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) - + u'/' + QCoreApplication::organizationName() + u"/Designer"_qs; + + u'/' + QCoreApplication::organizationName() + u"/Designer"_s; #else return legacyDataDirectory(); #endif diff --git a/src/designer/src/lib/shared/shared_settings.cpp b/src/designer/src/lib/shared/shared_settings.cpp index 6b91cff7a..a93c414dc 100644 --- a/src/designer/src/lib/shared/shared_settings.cpp +++ b/src/designer/src/lib/shared/shared_settings.cpp @@ -44,6 +44,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static const char *defaultGridKey = "defaultGrid"; static const char *previewKey = "Preview"; static const char *enabledKey = "Enabled"; @@ -123,7 +125,7 @@ const QStringList &QDesignerSharedSettings::defaultFormTemplatePaths() // ### FIXME Qt 8: Remove (QTBUG-96005) void QDesignerSharedSettings::migrateTemplates() { - const QString templatePath = u"/templates"_qs; + const QString templatePath = u"/templates"_s; QString path = dataDirectory() + templatePath; if (QFileInfo::exists(path)) return; diff --git a/src/linguist/linguist/printout.cpp b/src/linguist/linguist/printout.cpp index e80407ecc..f17332cec 100644 --- a/src/linguist/linguist/printout.cpp +++ b/src/linguist/linguist/printout.cpp @@ -33,11 +33,13 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + PrintOut::PrintOut(QPrinter *printer) : pr(printer), nextRule(NoRule), page(0) { p.begin(pr); - QFont f(QStringList{u"Arial"_qs}); + QFont f(QStringList{u"Arial"_s}); f8 = f; f8.setPointSize(8); f10 = f; diff --git a/src/linguist/lprodump/main.cpp b/src/linguist/lprodump/main.cpp index afc60655a..bd4ccbb10 100644 --- a/src/linguist/lprodump/main.cpp +++ b/src/linguist/lprodump/main.cpp @@ -49,6 +49,8 @@ #include <iostream> +using namespace Qt::StringLiterals; + static void printOut(const QString &out) { std::cout << qPrintable(out); @@ -105,7 +107,7 @@ Options: Comma-separated list of QMake variables containing .ts files. -version Display the version of lprodump and exit. -)"_qs); +)"_s); } static void print(const QString &fileName, int lineNo, const QString &msg) @@ -378,7 +380,7 @@ int main(int argc, char **argv) QCoreApplication app(argc, argv); QStringList args = app.arguments(); QStringList proFiles; - QStringList translationsVariables = { u"TRANSLATIONS"_qs }; + QStringList translationsVariables = { u"TRANSLATIONS"_s }; QString outDir = QDir::currentPath(); QHash<QString, QString> outDirMap; QString outputFilePath; @@ -394,7 +396,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-out")) { ++i; if (i == argc) { - printErr(u"The option -out requires a parameter.\n"_qs); + printErr(u"The option -out requires a parameter.\n"_s); return 1; } outputFilePath = args[i]; @@ -421,11 +423,11 @@ int main(int argc, char **argv) return 1; } outDir = QDir::cleanPath(QFileInfo(args[i]).absoluteFilePath()); - } else if (arg == u"-translations-variables"_qs) { + } else if (arg == u"-translations-variables"_s) { ++i; if (i == argc) { - printErr(u"The -translations-variables option must be followed by a "_qs - u"comma-separated list of variable names.\n"_qs); + printErr(u"The -translations-variables option must be followed by a "_s + u"comma-separated list of variable names.\n"_s); return 1; } translationsVariables = args.at(i).split(QLatin1Char(',')); diff --git a/src/linguist/lrelease-pro/main.cpp b/src/linguist/lrelease-pro/main.cpp index 25ee854d7..2eb650ee1 100644 --- a/src/linguist/lrelease-pro/main.cpp +++ b/src/linguist/lrelease-pro/main.cpp @@ -38,6 +38,8 @@ QT_USE_NAMESPACE +using namespace Qt::StringLiterals; + static void printOut(const QString &out) { std::cout << qPrintable(out); @@ -65,7 +67,7 @@ Options: Do not explain what is being done -version Display the version of lrelease-pro and exit -)"_qs); +)"_s); } int main(int argc, char **argv) @@ -121,7 +123,7 @@ int main(int argc, char **argv) const QStringList proFiles = extractProFiles(&inputFiles); if (proFiles.isEmpty()) { - printErr(u"lrelease-pro: No .pro/.pri files given.\n"_qs); + printErr(u"lrelease-pro: No .pro/.pri files given.\n"_s); return 1; } if (!inputFiles.isEmpty()) { diff --git a/src/linguist/lrelease/main.cpp b/src/linguist/lrelease/main.cpp index 49ff0cd62..6a9ae00c1 100644 --- a/src/linguist/lrelease/main.cpp +++ b/src/linguist/lrelease/main.cpp @@ -47,6 +47,8 @@ QT_USE_NAMESPACE +using namespace Qt::StringLiterals; + static void printOut(const QString & out) { QTextStream stream(stdout); @@ -94,7 +96,7 @@ Options: Do not explain what is being done -version Display the version of lrelease and exit -)"_qs); +)"_s); } static bool loadTsFile(Translator &tor, const QString &tsFileName, bool /* verbose */) diff --git a/src/linguist/lupdate-pro/main.cpp b/src/linguist/lupdate-pro/main.cpp index bd3aa5f2b..eec81b24a 100644 --- a/src/linguist/lupdate-pro/main.cpp +++ b/src/linguist/lupdate-pro/main.cpp @@ -42,6 +42,8 @@ #include <iostream> +using namespace Qt::StringLiterals; + static void printOut(const QString & out) { std::cout << qPrintable(out); @@ -75,7 +77,7 @@ Options: Trace processing .pro files. Specify twice for more verbosity. -version Display the version of lupdate-pro and exit. -)"_qs); +)"_s); } int main(int argc, char **argv) @@ -121,7 +123,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro")) { ++i; if (i == argc) { - printErr(u"The -pro option should be followed by a filename of .pro file.\n"_qs); + printErr(u"The -pro option should be followed by a filename of .pro file.\n"_s); return 1; } lprodumpOptions << arg << args[i]; @@ -129,7 +131,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro-out")) { ++i; if (i == argc) { - printErr(u"The -pro-out option should be followed by a directory name.\n"_qs); + printErr(u"The -pro-out option should be followed by a directory name.\n"_s); return 1; } lprodumpOptions << arg << args[i]; @@ -142,7 +144,7 @@ int main(int argc, char **argv) } // for args if (!hasProFiles) { - printErr(u"lupdate-pro: No .pro/.pri files given.\n"_qs); + printErr(u"lupdate-pro: No .pro/.pri files given.\n"_s); return 1; } diff --git a/src/linguist/lupdate/cpp_clang.cpp b/src/linguist/lupdate/cpp_clang.cpp index 4d2734bf8..db48b1c53 100644 --- a/src/linguist/lupdate/cpp_clang.cpp +++ b/src/linguist/lupdate/cpp_clang.cpp @@ -62,6 +62,8 @@ using clang::tooling::CompilationDatabase; QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + Q_LOGGING_CATEGORY(lcClang, "qt.lupdate.clang"); static QString getSysCompiler() @@ -464,7 +466,7 @@ void ClangCppParser::loadCPP(Translator &translator, const QStringList &files, C qCDebug(lcClang) << "Generating compilation database" << dbFilePath; if (!generateCompilationDatabase(dbFilePath, cd)) { *fail = true; - cd.appendError(u"Cannot generate compilation database."_qs); + cd.appendError(u"Cannot generate compilation database."_s); return; } errorMessage.clear(); diff --git a/src/linguist/lupdate/main.cpp b/src/linguist/lupdate/main.cpp index c28c19a2e..1ab525c79 100644 --- a/src/linguist/lupdate/main.cpp +++ b/src/linguist/lupdate/main.cpp @@ -49,6 +49,8 @@ #include <iostream> +using namespace Qt::StringLiterals; + bool useClangToParseCpp = false; QString commandLineCompilationDatabaseDir; // for the path to the json file passed as a command line argument. // Has priority over what is in the .pro file and passed to the project. @@ -757,11 +759,11 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-project")) { ++i; if (i == argc) { - printErr(u"The option -project requires a parameter.\n"_qs); + printErr(u"The option -project requires a parameter.\n"_s); return 1; } if (!projectDescriptionFile.isEmpty()) { - printErr(u"The option -project must appear only once.\n"_qs); + printErr(u"The option -project must appear only once.\n"_s); return 1; } projectDescriptionFile = args[i]; @@ -770,7 +772,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-target-language")) { ++i; if (i == argc) { - printErr(u"The option -target-language requires a parameter.\n"_qs); + printErr(u"The option -target-language requires a parameter.\n"_s); return 1; } targetLanguage = args[i]; @@ -778,7 +780,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-source-language")) { ++i; if (i == argc) { - printErr(u"The option -source-language requires a parameter.\n"_qs); + printErr(u"The option -source-language requires a parameter.\n"_s); return 1; } sourceLanguage = args[i]; @@ -786,7 +788,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-disable-heuristic")) { ++i; if (i == argc) { - printErr(u"The option -disable-heuristic requires a parameter.\n"_qs); + printErr(u"The option -disable-heuristic requires a parameter.\n"_s); return 1; } arg = args[i]; @@ -797,14 +799,14 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("number")) { options &= ~HeuristicNumber; } else { - printErr(u"Invalid heuristic name passed to -disable-heuristic.\n"_qs); + printErr(u"Invalid heuristic name passed to -disable-heuristic.\n"_s); return 1; } continue; } else if (arg == QLatin1String("-locations")) { ++i; if (i == argc) { - printErr(u"The option -locations requires a parameter.\n"_qs); + printErr(u"The option -locations requires a parameter.\n"_s); return 1; } if (args[i] == QLatin1String("none")) { @@ -814,7 +816,7 @@ int main(int argc, char **argv) } else if (args[i] == QLatin1String("absolute")) { options |= AbsoluteLocations; } else { - printErr(u"Invalid parameter passed to -locations.\n"_qs); + printErr(u"Invalid parameter passed to -locations.\n"_s); return 1; } continue; @@ -848,7 +850,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-extensions")) { ++i; if (i == argc) { - printErr(u"The -extensions option should be followed by an extension list.\n"_qs); + printErr(u"The -extensions option should be followed by an extension list.\n"_s); return 1; } extensions = args[i]; @@ -856,7 +858,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-tr-function-alias")) { ++i; if (i == argc) { - printErr(u"The -tr-function-alias option should be followed by a list of function=alias mappings.\n"_qs); + printErr(u"The -tr-function-alias option should be followed by a list of function=alias mappings.\n"_s); return 1; } if (!handleTrFunctionAliases(args[i])) @@ -865,7 +867,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro")) { ++i; if (i == argc) { - printErr(u"The -pro option should be followed by a filename of .pro file.\n"_qs); + printErr(u"The -pro option should be followed by a filename of .pro file.\n"_s); return 1; } QString file = QDir::cleanPath(QFileInfo(args[i]).absoluteFilePath()); @@ -875,7 +877,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro-out")) { ++i; if (i == argc) { - printErr(u"The -pro-out option should be followed by a directory name.\n"_qs); + printErr(u"The -pro-out option should be followed by a directory name.\n"_s); return 1; } outDir = QDir::cleanPath(QFileInfo(args[i]).absoluteFilePath()); @@ -884,7 +886,7 @@ int main(int argc, char **argv) if (arg.length() == 2) { ++i; if (i == argc) { - printErr(u"The -I option should be followed by a path.\n"_qs); + printErr(u"The -I option should be followed by a path.\n"_s); return 1; } includePath += args[i]; @@ -930,7 +932,7 @@ int main(int argc, char **argv) if (lineContent.startsWith(QLatin1String("-I"))) { if (lineContent.length() == 2) { - printErr(u"The -I option should be followed by a path.\n"_qs); + printErr(u"The -I option should be followed by a path.\n"_s); return 1; } includePath += lineContent.mid(2); @@ -1038,11 +1040,11 @@ int main(int argc, char **argv) if (!targetLanguage.isEmpty() && tsFileNames.count() != 1) printErr(u"lupdate warning: -target-language usually only" - " makes sense with exactly one TS file.\n"_qs); + " makes sense with exactly one TS file.\n"_s); QString errorString; if (!proFiles.isEmpty()) { - runInternalQtTool(u"lupdate-pro"_qs, app.arguments().mid(1)); + runInternalQtTool(u"lupdate-pro"_s, app.arguments().mid(1)); return 0; } @@ -1065,7 +1067,7 @@ int main(int argc, char **argv) if (projectDescription.empty()) { if (tsFileNames.isEmpty()) printErr(u"lupdate warning:" - " no TS files specified. Only diagnostics will be produced.\n"_qs); + " no TS files specified. Only diagnostics will be produced.\n"_s); Translator fetchedTor; ConversionData cd; diff --git a/src/linguist/lupdate/ui.cpp b/src/linguist/lupdate/ui.cpp index 1737b5342..c71ee45e6 100644 --- a/src/linguist/lupdate/ui.cpp +++ b/src/linguist/lupdate/ui.cpp @@ -39,6 +39,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + class UiReader : public XmlParser { public: @@ -192,7 +194,7 @@ bool loadUI(Translator &translator, const QString &filename, ConversionData &cd) UiReader uiReader(translator, cd, reader); bool result = uiReader.parse(); if (!result) - cd.appendError(u"Parse error in UI file"_qs); + cd.appendError(u"Parse error in UI file"_s); return result; } diff --git a/src/pixeltool/qpixeltool.cpp b/src/pixeltool/qpixeltool.cpp index 03126cfbe..8bf4c761d 100644 --- a/src/pixeltool/qpixeltool.cpp +++ b/src/pixeltool/qpixeltool.cpp @@ -53,6 +53,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + static QPoint initialPos(const QSettings &settings, const QSize &initialSize) { const QPoint defaultPos = QGuiApplication::primaryScreen()->availableGeometry().topLeft(); @@ -231,7 +233,7 @@ void QPixelTool::paintEvent(QPaintEvent *) } } - QFont f(QStringList{u"courier"_qs}, -1, QFont::Bold); + QFont f(QStringList{u"courier"_s}, -1, QFont::Bold); p.setFont(f); if (m_displayZoom) { diff --git a/src/qdoc/doc.cpp b/src/qdoc/doc.cpp index cae8b0242..9b023dacd 100644 --- a/src/qdoc/doc.cpp +++ b/src/qdoc/doc.cpp @@ -40,6 +40,8 @@ QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; + DocUtilities &Doc::m_utilities = DocUtilities::instance(); /*! @@ -72,11 +74,11 @@ Doc::Doc(const Location &start_loc, const Location &end_loc, const QString &sour parser.parse(source, m_priv, metaCommandSet, topics); if (Config::instance().getAtomsDump()) { - start_loc.information(u"==== Atoms Structure for block comment starting at %1 ===="_qs.arg( + start_loc.information(u"==== Atoms Structure for block comment starting at %1 ===="_s.arg( start_loc.toString())); body().dump(); end_loc.information( - u"==== Ending atoms Structure for block comment ending at %1 ===="_qs.arg( + u"==== Ending atoms Structure for block comment ending at %1 ===="_s.arg( end_loc.toString())); } } diff --git a/src/qdoc/tokenizer.h b/src/qdoc/tokenizer.h index a7b1728fb..2ba0e60cf 100644 --- a/src/qdoc/tokenizer.h +++ b/src/qdoc/tokenizer.h @@ -140,6 +140,8 @@ private: inline int getChar() { + using namespace Qt::StringLiterals; + if (m_ch == EOF) return EOF; if (m_lexLen < yyLexBufSize - 1) { @@ -147,8 +149,8 @@ private: m_lex[m_lexLen] = '\0'; } else if (!token_too_long_warning_was_issued) { location().warning( - u"The content is too long.\n"_qs, - u"The maximum amount of characters for this content is %1.\n"_qs.arg(yyLexBufSize) + + u"The content is too long.\n"_s, + u"The maximum amount of characters for this content is %1.\n"_s.arg(yyLexBufSize) + "Consider splitting it or reducing its size." ); |