Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package qtxdg-tools for openSUSE:Factory checked in at 2025-04-22 17:26:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/qtxdg-tools (Old) and /work/SRC/openSUSE:Factory/.qtxdg-tools.new.30101 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "qtxdg-tools" Tue Apr 22 17:26:46 2025 rev:7 rq:1271084 version:4.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/qtxdg-tools/qtxdg-tools.changes 2024-11-11 13:46:05.785749536 +0100 +++ /work/SRC/openSUSE:Factory/.qtxdg-tools.new.30101/qtxdg-tools.changes 2025-04-22 17:27:10.792303290 +0200 @@ -1,0 +2,7 @@ +Thu Apr 17 14:14:49 UTC 2025 - Shawn Dunn <sfal...@opensuse.org> + +- Update to version 4.2.0: + * Modernized the strings by using 'QLatin1StringView' and string + operators. Also removed the 'xdgmacros' header + +------------------------------------------------------------------- Old: ---- qtxdg-tools-4.1.0.tar.xz qtxdg-tools-4.1.0.tar.xz.asc New: ---- qtxdg-tools-4.2.0.tar.xz qtxdg-tools-4.2.0.tar.xz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ qtxdg-tools.spec ++++++ --- /var/tmp/diff_new_pack.QE2l8b/_old 2025-04-22 17:27:11.524334010 +0200 +++ /var/tmp/diff_new_pack.QE2l8b/_new 2025-04-22 17:27:11.528334178 +0200 @@ -17,7 +17,7 @@ Name: qtxdg-tools -Version: 4.1.0 +Version: 4.2.0 Release: 0 Summary: User tools for libqtxg License: LGPL-2.1-or-later ++++++ qtxdg-tools-4.1.0.tar.xz -> qtxdg-tools-4.2.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/CHANGELOG new/qtxdg-tools-4.2.0/CHANGELOG --- old/qtxdg-tools-4.1.0/CHANGELOG 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/CHANGELOG 2025-04-17 10:33:20.000000000 +0200 @@ -1,3 +1,7 @@ +qtxdg-tools-4.2.0 / 2025-04-17 +=============================== + * Modernized the strings by using `QLatin1StringView` and string operators. Also, removed the `xdgmacros` header. + qtxdg-tools-4.1.0 / 2024-11-05 =============================== * Do not include `file://` when opening local files. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/CMakeLists.txt new/qtxdg-tools-4.2.0/CMakeLists.txt --- old/qtxdg-tools-4.1.0/CMakeLists.txt 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/CMakeLists.txt 2025-04-17 10:33:20.000000000 +0200 @@ -7,12 +7,12 @@ project(qtxdg-tools) set(QTXDG_TOOLS_MAJOR_VERSION 4) -set(QTXDG_TOOLS_MINOR_VERSION 1) +set(QTXDG_TOOLS_MINOR_VERSION 2) set(QTXDG_TOOLS_PATCH_VERSION 0) set(QTXDG_TOOLS_VERSION_STRING ${QTXDG_TOOLS_MAJOR_VERSION}.${QTXDG_TOOLS_MINOR_VERSION}.${QTXDG_TOOLS_PATCH_VERSION}) -set(LXQTBT_MINIMUM_VERSION "2.1.0") -set(QTXDG_MINIMUM_VERSION "4.1.0") +set(LXQTBT_MINIMUM_VERSION "2.2.0") +set(QTXDG_MINIMUM_VERSION "4.2.0") set(QT_MINIMUM_VERSION "6.6.0") find_package(lxqt2-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/defappmatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/defappmatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/defappmatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/defappmatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -22,7 +22,6 @@ #include "matglobals.h" #include "xdgdesktopfile.h" -#include "xdgmacros.h" #include "xdgmimeapps.h" #include <QCommandLineOption> @@ -32,6 +31,8 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + enum DefAppCommandMode { CommandModeGetDefApp, CommandModeSetDefApp @@ -48,13 +49,13 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefAppData *data, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Get/Set the default application for a mimetype")); + parser->setApplicationDescription(u"Get/Set the default application for a mimetype"_s); - parser->addPositionalArgument(QL1S("defapp"), QSL("mimetype(s)"), + parser->addPositionalArgument(u"defapp"_s, u"mimetype(s)"_s, QCoreApplication::tr("[mimetype(s)...]")); - const QCommandLineOption defAppNameOption(QStringList() << QSL("s") << QSL("set"), - QSL("Application to be set as default"), QSL("app name")); + const QCommandLineOption defAppNameOption(QStringList() << u"s"_s << u"set"_s, + u"Application to be set as default"_s, u"app name"_s); parser->addOption(defAppNameOption); const QCommandLineOption helpOption = parser->addHelpOption(); @@ -69,7 +70,7 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } @@ -80,21 +81,21 @@ defAppName = parser->value(defAppNameOption); if (isDefAppNameSet && defAppName.isEmpty()) { - *errorMessage = QSL("No application name"); + *errorMessage = u"No application name"_s; return CommandLineError; } QStringList mimeTypes = parser->positionalArguments(); if (mimeTypes.size() < 2) { - *errorMessage = QSL("MimeType missing"); + *errorMessage = u"MimeType missing"_s; return CommandLineError; } mimeTypes.removeAt(0); if (!isDefAppNameSet && mimeTypes.size() > 1) { - *errorMessage = QSL("Only one mimeType, please"); + *errorMessage = u"Only one mimeType, please"_s; return CommandLineError; } @@ -106,8 +107,8 @@ } DefAppMatCommand::DefAppMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("defapp"), - QL1S("Get/Set the default application for a mimetype"), + : MatCommandInterface(u"defapp"_s, + u"Get/Set the default application for a mimetype"_s, parser) { Q_CHECK_PTR(parser); @@ -148,22 +149,22 @@ std::cout << qPrintable(XdgDesktopFile::id(defApp->fileName())) << "\n"; delete defApp; } else { -// std::cout << qPrintable(QSL("No default application for '%1'\n").arg(mimeType)); +// std::cout << qPrintable(u"No default application for '%1'\n"_s.arg(mimeType)); } } else { // Set default App XdgDesktopFile app; if (!app.load(data.defAppName)) { - std::cerr << qPrintable(QSL("Could not find find '%1'\n").arg(data.defAppName)); + std::cerr << qPrintable(u"Could not find find '%1'\n"_s.arg(data.defAppName)); return EXIT_FAILURE; } XdgMimeApps apps; for (const QString &mimeType : std::as_const(data.mimeTypes)) { if (!apps.setDefaultApp(mimeType, app)) { - std::cerr << qPrintable(QSL("Could not set '%1' as default for '%2'\n").arg(app.fileName(), mimeType)); + std::cerr << qPrintable(u"Could not set '%1' as default for '%2'\n"_s.arg(app.fileName(), mimeType)); success = false; } else { - std::cout << qPrintable(QSL("Set '%1' as default for '%2'\n").arg(app.fileName(), mimeType)); + std::cout << qPrintable(u"Set '%1' as default for '%2'\n"_s.arg(app.fileName(), mimeType)); } } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/defemailclientmatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/defemailclientmatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/defemailclientmatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/defemailclientmatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -21,7 +21,6 @@ #include "defemailclientmatcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdefaultapps.h" #include "xdgdesktopfile.h" @@ -34,6 +33,8 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + enum DefEmailClientCommandMode { CommandModeGetDefEmailClient, CommandModeSetDefEmailClient, @@ -50,15 +51,15 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefEmailClientData *data, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Get/Set the default email client")); + parser->setApplicationDescription(u"Get/Set the default email client"_s); - parser->addPositionalArgument(QL1S("def-email-client"), QL1S()); + parser->addPositionalArgument(u"def-email-client"_s, ""_L1); - const QCommandLineOption defEmailClientNameOption(QStringList() << QSL("s") << QSL("set"), - QSL("Email Client to be set as default"), QSL("email client")); + const QCommandLineOption defEmailClientNameOption(QStringList() << u"s"_s << u"set"_s, + u"Email Client to be set as default"_s, u"email client"_s); - const QCommandLineOption listAvailableOption(QStringList() << QSL("l") << QSL("list-available"), - QSL("List available email clients")); + const QCommandLineOption listAvailableOption(QStringList() << u"l"_s << u"list-available"_s, + u"List available email clients"_s); parser->addOption(defEmailClientNameOption); parser->addOption(listAvailableOption); @@ -74,7 +75,7 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } @@ -89,18 +90,18 @@ posArgs.removeAt(0); if (isDefEmailClientNameSet && !posArgs.empty()) { - *errorMessage = QSL("Extra arguments given: "); - errorMessage->append(posArgs.join(QLatin1Char(','))); + *errorMessage = u"Extra arguments given: "_s; + errorMessage->append(posArgs.join(u',')); return CommandLineError; } if (!isDefEmailClientNameSet && !posArgs.empty()) { - *errorMessage = QSL("To set the default email client use the -s/--set option"); + *errorMessage = u"To set the default email client use the -s/--set option"_s; return CommandLineError; } if (isListAvailableSet && (isDefEmailClientNameSet || !posArgs.empty())) { - *errorMessage = QSL("list-available can't be used with other options and doesn't take arguments"); + *errorMessage = u"list-available can't be used with other options and doesn't take arguments"_s; return CommandLineError; } @@ -115,8 +116,8 @@ } DefEmailClientMatCommand::DefEmailClientMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("def-email-client"), - QSL("Get/Set the default email client"), + : MatCommandInterface(u"def-email-client"_s, + u"Get/Set the default email client"_s, parser) { Q_CHECK_PTR(parser); @@ -167,13 +168,13 @@ XdgDesktopFile toSetDefEmailClient; if (toSetDefEmailClient.load(data.defEmailClientName)) { if (XdgDefaultApps::setEmailClient(toSetDefEmailClient)) { - std::cout << qPrintable(QSL("Set '%1' as the default email client\n").arg(toSetDefEmailClient.fileName())); + std::cout << qPrintable(u"Set '%1' as the default email client\n"_s.arg(toSetDefEmailClient.fileName())); } else { - std::cerr << qPrintable(QSL("Could not set '%1' as the default email client\n").arg(toSetDefEmailClient.fileName())); + std::cerr << qPrintable(u"Could not set '%1' as the default email client\n"_s.arg(toSetDefEmailClient.fileName())); success = false; } } else { // could not load application file - std::cerr << qPrintable(QSL("Could not find find '%1'\n").arg(data.defEmailClientName)); + std::cerr << qPrintable(u"Could not find find '%1'\n"_s.arg(data.defEmailClientName)); success = false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/deffilemanagermatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/deffilemanagermatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/deffilemanagermatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/deffilemanagermatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -21,7 +21,6 @@ #include "deffilemanagermatcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdefaultapps.h" #include "xdgdesktopfile.h" @@ -34,6 +33,8 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + enum DefFileManagerCommandMode { CommandModeGetDefFileManager, CommandModeSetDefFileManager, @@ -50,15 +51,15 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefFileManagerData *data, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Get/Set the default file manager")); + parser->setApplicationDescription(u"Get/Set the default file manager"_s); - parser->addPositionalArgument(QL1S("def-file-manager"), QL1S()); + parser->addPositionalArgument(u"def-file-manager"_s, ""_L1); - const QCommandLineOption defFileManagerNameOption(QStringList() << QSL("s") << QSL("set"), - QSL("File Manager to be set as default"), QSL("file manager")); + const QCommandLineOption defFileManagerNameOption(QStringList() << u"s"_s << u"set"_s, + u"File Manager to be set as default"_s, u"file manager"_s); - const QCommandLineOption listAvailableOption(QStringList() << QSL("l") << QSL("list-available"), - QSL("List available file managers")); + const QCommandLineOption listAvailableOption(QStringList() << u"l"_s << u"list-available"_s, + u"List available file managers"_s); parser->addOption(defFileManagerNameOption); parser->addOption(listAvailableOption); @@ -74,7 +75,7 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } @@ -89,18 +90,18 @@ posArgs.removeAt(0); if (isDefFileManagerNameSet && !posArgs.empty()) { - *errorMessage = QSL("Extra arguments given: "); - errorMessage->append(posArgs.join(QLatin1Char(','))); + *errorMessage = u"Extra arguments given: "_s; + errorMessage->append(posArgs.join(u',')); return CommandLineError; } if (!isDefFileManagerNameSet && !posArgs.empty()) { - *errorMessage = QSL("To set the default file manager use the -s/--set option"); + *errorMessage = u"To set the default file manager use the -s/--set option"_s; return CommandLineError; } if (isListAvailableSet && (isDefFileManagerNameSet || !posArgs.empty())) { - *errorMessage = QSL("list-available can't be used with other options and doesn't take arguments"); + *errorMessage = u"list-available can't be used with other options and doesn't take arguments"_s; return CommandLineError; } @@ -115,8 +116,8 @@ } DefFileManagerMatCommand::DefFileManagerMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("def-file-manager"), - QSL("Get/Set the default file manager"), + : MatCommandInterface(u"def-file-manager"_s, + u"Get/Set the default file manager"_s, parser) { Q_CHECK_PTR(parser); @@ -167,13 +168,13 @@ XdgDesktopFile toSetDefFileManager; if (toSetDefFileManager.load(data.defFileManagerName)) { if (XdgDefaultApps::setFileManager(toSetDefFileManager)) { - std::cout << qPrintable(QSL("Set '%1' as the default file manager\n").arg(toSetDefFileManager.fileName())); + std::cout << qPrintable(u"Set '%1' as the default file manager\n"_s.arg(toSetDefFileManager.fileName())); } else { - std::cerr << qPrintable(QSL("Could not set '%1' as the default file manager\n").arg(toSetDefFileManager.fileName())); + std::cerr << qPrintable(u"Could not set '%1' as the default file manager\n"_s.arg(toSetDefFileManager.fileName())); success = false; } } else { // could not load application file - std::cerr << qPrintable(QSL("Could not find find '%1'\n").arg(data.defFileManagerName)); + std::cerr << qPrintable(u"Could not find find '%1'\n"_s.arg(data.defFileManagerName)); success = false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/defterminalmatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/defterminalmatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/defterminalmatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/defterminalmatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -21,7 +21,6 @@ #include "defterminalmatcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdefaultapps.h" #include "xdgdesktopfile.h" @@ -35,6 +34,8 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + enum DefTerminalCommandMode { CommandModeGetDefTerminal, CommandModeSetDefTerminal, @@ -51,15 +52,15 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefTerminalData *data, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Get/Set the default terminal")); + parser->setApplicationDescription(u"Get/Set the default terminal"_s); - parser->addPositionalArgument(QL1S("def-terminal"), QL1S()); + parser->addPositionalArgument(u"def-terminal"_s, ""_L1); - const QCommandLineOption defTerminalNameOption(QStringList() << QSL("s") << QSL("set"), - QSL("Terminal to be set as default"), QSL("terminal")); + const QCommandLineOption defTerminalNameOption(QStringList() << u"s"_s << u"set"_s, + u"Terminal to be set as default"_s, u"terminal"_s); - const QCommandLineOption listAvailableOption(QStringList() << QSL("l") << QSL("list-available"), - QSL("List available terminals")); + const QCommandLineOption listAvailableOption(QStringList() << u"l"_s << u"list-available"_s, + u"List available terminals"_s); parser->addOption(defTerminalNameOption); parser->addOption(listAvailableOption); @@ -75,7 +76,7 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } @@ -90,18 +91,18 @@ posArgs.removeAt(0); if (isDefTerminalNameSet && !posArgs.empty()) { - *errorMessage = QSL("Extra arguments given: "); - errorMessage->append(posArgs.join(QLatin1Char(','))); + *errorMessage = u"Extra arguments given: "_s; + errorMessage->append(posArgs.join(u',')); return CommandLineError; } if (!isDefTerminalNameSet && !posArgs.empty()) { - *errorMessage = QSL("To set the default terminal use the -s/--set option"); + *errorMessage = u"To set the default terminal use the -s/--set option"_s; return CommandLineError; } if (isListAvailableSet && (isDefTerminalNameSet || !posArgs.empty())) { - *errorMessage = QSL("list-available can't be used with other options and doesn't take arguments"); + *errorMessage = u"list-available can't be used with other options and doesn't take arguments"_s; return CommandLineError; } @@ -116,8 +117,8 @@ } DefTerminalMatCommand::DefTerminalMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("def-terminal"), - QSL("Get/Set the default terminal"), + : MatCommandInterface(u"def-terminal"_s, + u"Get/Set the default terminal"_s, parser) { Q_CHECK_PTR(parser); @@ -171,13 +172,13 @@ XdgDesktopFile toSetDefTerminal; if (toSetDefTerminal.load(data.defTerminalName)) { if (XdgDefaultApps::setTerminal(toSetDefTerminal)) { - std::cout << qPrintable(QSL("Set '%1' as the default terminal\n").arg(toSetDefTerminal.fileName())); + std::cout << qPrintable(u"Set '%1' as the default terminal\n"_s.arg(toSetDefTerminal.fileName())); } else { - std::cerr << qPrintable(QSL("Could not set '%1' as the default terminal\n").arg(toSetDefTerminal.fileName())); + std::cerr << qPrintable(u"Could not set '%1' as the default terminal\n"_s.arg(toSetDefTerminal.fileName())); success = false; } } else { // could not load application file - std::cerr << qPrintable(QSL("Could not find find '%1'\n").arg(data.defTerminalName)); + std::cerr << qPrintable(u"Could not find find '%1'\n"_s.arg(data.defTerminalName)); success = false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/defwebbrowsermatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/defwebbrowsermatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/defwebbrowsermatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/defwebbrowsermatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -21,7 +21,6 @@ #include "defwebbrowsermatcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdefaultapps.h" #include "xdgdesktopfile.h" @@ -34,6 +33,8 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + enum DefWebBrowserCommandMode { CommandModeGetDefWebBrowser, CommandModeSetDefWebBrowser, @@ -50,15 +51,15 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, DefWebBrowserData *data, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Get/Set the default web browser")); + parser->setApplicationDescription(u"Get/Set the default web browser"_s); - parser->addPositionalArgument(QL1S("def-web-browser"), QL1S()); + parser->addPositionalArgument(u"def-web-browser"_s, ""_L1); - const QCommandLineOption defWebBrowserNameOption(QStringList() << QSL("s") << QSL("set"), - QSL("Web Browser to be set as default"), QSL("web bowser")); + const QCommandLineOption defWebBrowserNameOption(QStringList() << u"s"_s << u"set"_s, + u"Web Browser to be set as default"_s, u"web bowser"_s); - const QCommandLineOption listAvailableOption(QStringList() << QSL("l") << QSL("list-available"), - QSL("List available web browsers")); + const QCommandLineOption listAvailableOption(QStringList() << u"l"_s << u"list-available"_s, + u"List available web browsers"_s); parser->addOption(defWebBrowserNameOption); parser->addOption(listAvailableOption); @@ -74,7 +75,7 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } @@ -89,18 +90,18 @@ posArgs.removeAt(0); if (isDefWebBrowserNameSet && !posArgs.empty()) { - *errorMessage = QSL("Extra arguments given: "); - errorMessage->append(posArgs.join(QLatin1Char(','))); + *errorMessage = u"Extra arguments given: "_s; + errorMessage->append(posArgs.join(u',')); return CommandLineError; } if (!isDefWebBrowserNameSet && !posArgs.empty()) { - *errorMessage = QSL("To set the default browser use the -s/--set option"); + *errorMessage = u"To set the default browser use the -s/--set option"_s; return CommandLineError; } if (isListAvailableSet && (isDefWebBrowserNameSet || !posArgs.empty())) { - *errorMessage = QSL("list-available can't be used with other options and doesn't take arguments"); + *errorMessage = u"list-available can't be used with other options and doesn't take arguments"_s; return CommandLineError; } @@ -115,8 +116,8 @@ } DefWebBrowserMatCommand::DefWebBrowserMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("def-web-browser"), - QSL("Get/Set the default web browser"), + : MatCommandInterface(u"def-web-browser"_s, + u"Get/Set the default web browser"_s, parser) { Q_CHECK_PTR(parser); @@ -167,13 +168,13 @@ XdgDesktopFile toSetDefWebBrowser; if (toSetDefWebBrowser.load(data.defWebBrowserName)) { if (XdgDefaultApps::setWebBrowser(toSetDefWebBrowser)) { - std::cout << qPrintable(QSL("Set '%1' as the default web browser\n").arg(toSetDefWebBrowser.fileName())); + std::cout << qPrintable(u"Set '%1' as the default web browser\n"_s.arg(toSetDefWebBrowser.fileName())); } else { - std::cerr << qPrintable(QSL("Could not set '%1' as the default web browser\n").arg(toSetDefWebBrowser.fileName())); + std::cerr << qPrintable(u"Could not set '%1' as the default web browser\n"_s.arg(toSetDefWebBrowser.fileName())); success = false; } } else { // could not load application file - std::cerr << qPrintable(QSL("Could not find find '%1'\n").arg(data.defWebBrowserName)); + std::cerr << qPrintable(u"Could not find find '%1'\n"_s.arg(data.defWebBrowserName)); success = false; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/matcommandinterface.cpp new/qtxdg-tools-4.2.0/src/mat/matcommandinterface.cpp --- old/qtxdg-tools-4.1.0/src/mat/matcommandinterface.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/matcommandinterface.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -20,8 +20,6 @@ #include "matcommandinterface.h" -#include "xdgmacros.h" - #include <QCommandLineParser> MatCommandInterface::MatCommandInterface(const QString &name, const QString &description, QCommandLineParser *parser) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/matcommandmanager.cpp new/qtxdg-tools-4.2.0/src/mat/matcommandmanager.cpp --- old/qtxdg-tools-4.1.0/src/mat/matcommandmanager.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/matcommandmanager.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -20,12 +20,11 @@ #include "matcommandmanager.h" -#include "xdgmacros.h" - #include "matcommandinterface.h" #include <QDebug> +using namespace Qt::Literals::StringLiterals; MatCommandManager::MatCommandManager() = default; @@ -49,7 +48,7 @@ { QString text; int longestName = 0; - const QLatin1String doubleSpace(" "); + const auto doubleSpace = " "_L1; for (const auto *cmd : std::as_const(mCommands)) { longestName = qMax(longestName, cmd->name().size()); @@ -57,8 +56,8 @@ longestName += 2; // account for the inital dobule space for (const auto *cmd : std::as_const(mCommands)) { QString ptext = doubleSpace + cmd->name(); - ptext = ptext.leftJustified(longestName, QL1C(' ')); - ptext += doubleSpace + cmd->description() + QL1C('\n'); + ptext = ptext.leftJustified(longestName, u' '); + ptext += doubleSpace + cmd->description() + u'\n'; text.append(ptext); } return text; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/mimetypematcommand.cpp new/qtxdg-tools-4.2.0/src/mat/mimetypematcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/mimetypematcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/mimetypematcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -20,7 +20,6 @@ #include "mimetypematcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdesktopfile.h" #include "xdgmimeapps.h" @@ -37,9 +36,11 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + MimeTypeMatCommand::MimeTypeMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("mimetype"), - QL1S("Determines a file (mime)type"), + : MatCommandInterface(u"mimetype"_s, + u"Determines a file (mime)type"_s, parser) { } @@ -49,9 +50,9 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, QString *file, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Determines a file (mime)type")); + parser->setApplicationDescription(u"Determines a file (mime)type"_s); - parser->addPositionalArgument(QL1S("mimetype"), QSL("file | URL"), + parser->addPositionalArgument(u"mimetype"_s, u"file | URL"_s, QCoreApplication::tr("[file | URL]")); const QCommandLineOption helpOption = parser->addHelpOption(); @@ -66,20 +67,20 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } QStringList fs = parser->positionalArguments(); if (fs.size() < 2) { - *errorMessage = QSL("No file given"); + *errorMessage = u"No file given"_s; return CommandLineError; } fs.removeAt(0); if (fs.size() > 1) { - *errorMessage = QSL("Only one file, please"); + *errorMessage = u"Only one file, please"_s; return CommandLineError; } *file = fs.at(0); @@ -117,7 +118,7 @@ if (scheme.isEmpty()) { isLocalFile = true; localFilename = file; - } else if (scheme == QL1S("file")) { + } else if (scheme == "file"_L1) { isLocalFile = true; localFilename = QUrl(file).toLocalFile(); } @@ -125,7 +126,7 @@ if (isLocalFile) { const QFileInfo info(file); if (!info.exists(localFilename)) { - std::cerr << qPrintable(QSL("Cannot access '%1': No such file or directory\n").arg(file)); + std::cerr << qPrintable(u"Cannot access '%1': No such file or directory\n"_s.arg(file)); return EXIT_FAILURE; } else { QMimeDatabase mimeDb; @@ -134,7 +135,7 @@ return EXIT_SUCCESS; } } else { // not a local file - std::cerr << qPrintable(QSL("Can't handle '%1': '%2' scheme not supported\n").arg(file, scheme)); + std::cerr << qPrintable(u"Can't handle '%1': '%2' scheme not supported\n"_s.arg(file, scheme)); return EXIT_FAILURE; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/openmatcommand.cpp new/qtxdg-tools-4.2.0/src/mat/openmatcommand.cpp --- old/qtxdg-tools-4.1.0/src/mat/openmatcommand.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/openmatcommand.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -21,7 +21,6 @@ #include "openmatcommand.h" #include "matglobals.h" -#include "xdgmacros.h" #include "xdgdesktopfile.h" #include "xdgmimeapps.h" @@ -38,9 +37,11 @@ #include <iostream> +using namespace Qt::Literals::StringLiterals; + OpenMatCommand::OpenMatCommand(QCommandLineParser *parser) - : MatCommandInterface(QL1S("open"), - QSL("Open files with the default application"), + : MatCommandInterface(u"open"_s, + u"Open files with the default application"_s, parser) { } @@ -50,9 +51,9 @@ static CommandLineParseResult parseCommandLine(QCommandLineParser *parser, QStringList *files, QString *errorMessage) { parser->clearPositionalArguments(); - parser->setApplicationDescription(QL1S("Open files with the default application")); + parser->setApplicationDescription(u"Open files with the default application"_s); - parser->addPositionalArgument(QL1S("open"), QSL("files | URLs"), + parser->addPositionalArgument(u"open"_s, u"files | URLs"_s, QCoreApplication::tr("[files | URLs]")); const QCommandLineOption helpOption = parser->addHelpOption(); @@ -67,13 +68,13 @@ return CommandLineVersionRequested; } - if (parser->isSet(helpOption) || parser->isSet(QSL("help-all"))) { + if (parser->isSet(helpOption) || parser->isSet(u"help-all"_s)) { return CommandLineHelpRequested; } QStringList fs = parser->positionalArguments(); if (fs.size() < 2) { - *errorMessage = QSL("No file or URL given"); + *errorMessage = u"No file or URL given"_s; return CommandLineError; } @@ -119,7 +120,7 @@ if (scheme.isEmpty()) { isLocalFile = true; localFilename = urlString; - } else if (scheme == QL1S("file")) { + } else if (scheme == "file"_L1) { isLocalFile = true; localFilename = QUrl(urlString).toLocalFile(); } @@ -127,27 +128,27 @@ if (isLocalFile) { const QFileInfo f (localFilename); if (!f.exists()) { - std::cerr << qPrintable(QSL("Cannot access %1: No such file or directory\n").arg(urlString)); + std::cerr << qPrintable(u"Cannot access %1: No such file or directory\n"_s.arg(urlString)); break; } else { const QMimeType mimeType = mimeDb.mimeTypeForFile(f); df = appsDb.defaultApp(mimeType.name()); } } else { // not a local file - const QString contentType = QString::fromLatin1("x-scheme-handler/%1").arg(scheme); + const QString contentType = u"x-scheme-handler/%1"_s.arg(scheme); df = appsDb.defaultApp(contentType); } if (df) { // default app found if (!df->startDetached(isLocalFile ? localFilename : urlString)) { std::cerr << qPrintable( - QSL("Error while running the default application (%1) for %2\n").arg(df->name(), urlString)); + u"Error while running the default application (%1) for %2\n"_s.arg(df->name(), urlString)); success = false; } delete df; df = nullptr; } else { // no default app found - std::cout << qPrintable(QSL("No default application for '%1'\n").arg(urlString)); + std::cout << qPrintable(u"No default application for '%1'\n"_s.arg(urlString)); } } return success ? EXIT_SUCCESS : EXIT_FAILURE; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/qtxdg-tools-4.1.0/src/mat/qtxdg-mat.cpp new/qtxdg-tools-4.2.0/src/mat/qtxdg-mat.cpp --- old/qtxdg-tools-4.1.0/src/mat/qtxdg-mat.cpp 2024-11-05 06:12:41.000000000 +0100 +++ new/qtxdg-tools-4.2.0/src/mat/qtxdg-mat.cpp 2025-04-17 10:33:20.000000000 +0200 @@ -27,13 +27,13 @@ #include "deffilemanagermatcommand.h" #include "defterminalmatcommand.h" -#include "xdgmacros.h" - #include <QCoreApplication> #include <QCommandLineOption> #include <QCommandLineParser> #include <QDebug> +using namespace Qt::Literals::StringLiterals; + extern void Q_CORE_EXPORT qt_call_post_routines(); [[noreturn]] void showHelp(const QString &parserHelp, const QString &commandsDescription, int exitCode = 0); @@ -41,7 +41,7 @@ [[noreturn]] void showHelp(const QString &parserHelp, const QString &commandsDescription, int exitCode) { QString text; - const QLatin1Char nl('\n'); + const auto nl(u'\n'); text.append(parserHelp); text.append(nl); @@ -58,16 +58,16 @@ { QCoreApplication app(argc, argv); int runResult = 0; - app.setApplicationName(QSL("qtxdg-mat")); - app.setApplicationVersion(QSL(QTXDG_TOOLS_VERSION)); - app.setOrganizationName(QSL("LXQt")); - app.setOrganizationDomain(QSL("lxqt.org")); + app.setApplicationName(u"qtxdg-mat"_s); + app.setApplicationVersion(QStringLiteral(QTXDG_TOOLS_VERSION)); + app.setOrganizationName(u"LXQt"_s); + app.setOrganizationDomain(u"lxqt.org"_s); QCommandLineParser parser; - parser.setApplicationDescription(QSL("QtXdg MimeApps Tool")); + parser.setApplicationDescription(u"QtXdg MimeApps Tool"_s); - parser.addPositionalArgument(QSL("command"), - QSL("Command to execute.")); + parser.addPositionalArgument(u"command"_s, + u"Command to execute."_s); QScopedPointer<MatCommandManager> manager(new MatCommandManager()); @@ -99,7 +99,7 @@ const QCommandLineOption helpOption = parser.addHelpOption(); const QCommandLineOption versionOption = parser.addVersionOption(); parser.parse(QCoreApplication::arguments()); - if (parser.isSet(helpOption) || parser.isSet(QSL("help-all"))) { + if (parser.isSet(helpOption) || parser.isSet(u"help-all"_s)) { showHelp(parser.helpText(), manager->descriptionsHelpText(), EXIT_SUCCESS); Q_UNREACHABLE(); }