From ee0c038543e650a6be175751766768a4bd69e9c3 Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Fri, 17 Nov 2023 16:44:37 +1100 Subject: [PATCH] Re-instate some code (since the previous commit worked) --- src/cli/main.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/cli/main.cpp b/src/cli/main.cpp index a8dfc463b..d2748fa64 100644 --- a/src/cli/main.cpp +++ b/src/cli/main.cpp @@ -28,7 +28,7 @@ #include #endif -//static Q_LOGGING_CATEGORY(lc, "dokit.cli.main", QtInfoMsg); +static Q_LOGGING_CATEGORY(lc, "dokit.cli.main", QtInfoMsg); inline bool haveConsole() { @@ -311,23 +311,23 @@ int main(int argc, char *argv[]) QCoreApplication::installTranslator(&libTranslator); } - return 0; + // Parse the command line. + const QStringList appArguments = QCoreApplication::arguments(); + QCommandLineParser parser; + /*const Command commandType = */parseCommandLine(appArguments, parser); + qCDebug(lc).noquote() << QCoreApplication::applicationName() << QCoreApplication::applicationVersion(); + qCDebug(lc).noquote() << "Qt" << qVersion() << "(runtime) [" QT_VERSION_STR " compile-time]"; +#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // QTranslator::filePath() added in Qt 5.15. + qCDebug(lc).noquote() << "App translations:" << + (appTranslator.filePath().isEmpty() ? QStringLiteral("") : appTranslator.filePath()); + qCDebug(lc).noquote() << "Library translations:" << + (libTranslator.filePath().isEmpty() ? QStringLiteral("") : libTranslator.filePath()); +#else + qCDebug(lc).noquote() << "App translations:" << (!appTranslator.isEmpty()); + qCDebug(lc).noquote() << "Lib translations:" << (!libTranslator.isEmpty()); +#endif -// // Parse the command line. -// const QStringList appArguments = QCoreApplication::arguments(); -// QCommandLineParser parser; -// const Command commandType = parseCommandLine(appArguments, parser); -// qCDebug(lc).noquote() << QCoreApplication::applicationName() << QCoreApplication::applicationVersion(); -// qCDebug(lc).noquote() << "Qt" << qVersion() << "(runtime) [" QT_VERSION_STR " compile-time]"; -//#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) // QTranslator::filePath() added in Qt 5.15. -// qCDebug(lc).noquote() << "App translations:" << -// (appTranslator.filePath().isEmpty() ? QStringLiteral("") : appTranslator.filePath()); -// qCDebug(lc).noquote() << "Library translations:" << -// (libTranslator.filePath().isEmpty() ? QStringLiteral("") : libTranslator.filePath()); -//#else -// qCDebug(lc).noquote() << "App translations:" << (!appTranslator.isEmpty()); -// qCDebug(lc).noquote() << "Lib translations:" << (!libTranslator.isEmpty()); -//#endif + return 0; // // Handle the given command. // AbstractCommand * const command = getCommandObject(commandType, &app);