diff options
author | Bocklage, Jens <Jens_Bocklage@mentor.com> | 2016-12-16 18:12:33 +0100 |
---|---|---|
committer | Bocklage, Jens <Jens_Bocklage@mentor.com> | 2016-12-16 18:12:33 +0100 |
commit | 0e3504774e4a889a3836c2eb2e02f4d38d3dc9b1 (patch) | |
tree | 3472ae62d578553a6c85fe69c2dbb95ae5898e82 /SampleAppTimeDate | |
parent | 1edc5d1bebfd4156b0b58d693f0431d17f20a508 (diff) |
Add parameter "quiet" to suppress outputs
This will disable all debug outputs. All!
Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'SampleAppTimeDate')
-rw-r--r-- | SampleAppTimeDate/src/main.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/SampleAppTimeDate/src/main.cpp b/SampleAppTimeDate/src/main.cpp index 6b03b49..5140b48 100644 --- a/SampleAppTimeDate/src/main.cpp +++ b/SampleAppTimeDate/src/main.cpp @@ -2,6 +2,10 @@ #include <QCommandLineParser> #include "timedateprovider.hpp" +void noOutput(QtMsgType, const QMessageLogContext &, const QString &) +{ +} + int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); @@ -15,8 +19,16 @@ int main(int argc, char *argv[]) parser.setApplicationDescription("AGL Sample app for StatusBar interface - see wwww... for more details"); parser.addHelpOption(); parser.addVersionOption(); + QCommandLineOption quietOption(QStringList() << "q" << "quiet", + QCoreApplication::translate("main", "Be quiet. No outputs.")); + parser.addOption(quietOption); parser.process(a); + if (parser.isSet(quietOption)) + { + qInstallMessageHandler(noOutput); + } + TimeDateProvider *tdp = new TimeDateProvider(); tdp->start(); |