diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-02-19 09:38:07 +0300 |
---|---|---|
committer | Egor Nemtsev <enemtsev@luxoft.com> | 2020-02-20 12:57:17 +0000 |
commit | 3a375803624e01aae6079950aa95ea7445eced28 (patch) | |
tree | e76f1ba3739bfaec35ea80179ade020636c33a85 | |
parent | 6c6166832b6ba439e89c2619b3553ccd1d91ca8e (diff) |
[cluster-app] turn off logging by default, add initial help
Fixes: AUTOSUITE-1487
Change-Id: I979b3ca0039f967494cde2114620e7e528774c0f
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
-rw-r--r-- | src/neptune-cluster-app/main.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/neptune-cluster-app/main.cpp b/src/neptune-cluster-app/main.cpp index 90e93298..b473713b 100644 --- a/src/neptune-cluster-app/main.cpp +++ b/src/neptune-cluster-app/main.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2019-2020 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Neptune 3 UI. @@ -34,7 +34,10 @@ #include <QtGui/QIcon> #include <QtGui/QOpenGLContext> #include <QtQml/QQmlApplicationEngine> +#include <QtCore/QLoggingCategory> #include <QtCore/QDir> +#include <QtCore/QString> +#include <QtCore/QCommandLineParser> #ifdef STUDIO3D_RUNTIME_INSTALLED #include <qstudio3dglobal.h> @@ -43,9 +46,22 @@ int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QCoreApplication::setApplicationName(QStringLiteral("Neptune Cluster")); + QCoreApplication::setOrganizationName(QStringLiteral("Luxoft Sweden AB")); + QCoreApplication::setOrganizationDomain(QStringLiteral("luxoft.com")); + QCoreApplication::setApplicationVersion("0.1"); QGuiApplication app(argc, argv); - // @todo: add am.config or smth + // @todo: add -c config file option and config file for it (json, xml, etc) + QCommandLineParser cmdParser; + cmdParser.setApplicationDescription( + "Neptune Cluster\n\n" + "Logging is turned off by default, use QT_LOGGING_RULES to change this\n"); + cmdParser.addHelpOption(); + cmdParser.process(app); + + QLoggingCategory::setFilterRules("*=false"); + if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE_PATH")) { qputenv("QT_QUICK_CONTROLS_STYLE_PATH" , (QCoreApplication::applicationDirPath() + QStringLiteral("/styles")).toLocal8Bit()); |