summaryrefslogtreecommitdiffstats
path: root/sampleapptimedate/src/main.cpp
diff options
context:
space:
mode:
authorBocklage, Jens <Jens_Bocklage@mentor.com>2017-01-18 15:25:38 +0100
committerBocklage, Jens <Jens_Bocklage@mentor.com>2017-01-18 15:25:38 +0100
commit0592a405aa68f3baf6773795efa5522e4ee16779 (patch)
treea154927827fee732c65947f4eae171658f63fb77 /sampleapptimedate/src/main.cpp
parent6fcde5166305cd40b5816c4495290984ca925ab6 (diff)
Initial source commit
Taken from https://gerrit.automotivelinux.org/gerrit/p/staging/HomeScreen.git Signed-off-by: Bocklage, Jens <Jens_Bocklage@mentor.com>
Diffstat (limited to 'sampleapptimedate/src/main.cpp')
-rw-r--r--sampleapptimedate/src/main.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/sampleapptimedate/src/main.cpp b/sampleapptimedate/src/main.cpp
new file mode 100644
index 0000000..5140b48
--- /dev/null
+++ b/sampleapptimedate/src/main.cpp
@@ -0,0 +1,36 @@
+#include <QCoreApplication>
+#include <QCommandLineParser>
+#include "timedateprovider.hpp"
+
+void noOutput(QtMsgType, const QMessageLogContext &, const QString &)
+{
+}
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QCoreApplication::setOrganizationDomain("LinuxFoundation");
+ QCoreApplication::setOrganizationName("AutomotiveGradeLinux");
+ QCoreApplication::setApplicationName("SampleAppTimeDate");
+ QCoreApplication::setApplicationVersion("0.7.0");
+
+ QCommandLineParser parser;
+ 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();
+
+ return a.exec();
+}