comparison ui/main.cpp @ 829:294d76174102

(issue5) Add --version to trustbridge and trustbridge-admin
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 24 Jul 2014 11:41:52 +0200
parents 8de162b91a22
children c9a31544aaab
comparison
equal deleted inserted replaced
828:95e14add5c50 829:294d76174102
33 33
34 #ifndef ORGANIZATION 34 #ifndef ORGANIZATION
35 #define ORGANIZATION "BSI" 35 #define ORGANIZATION "BSI"
36 #endif 36 #endif
37 37
38 #define COPYRIGHT "Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik \n" \
39 "Software engineering by Intevation GmbH \n\n" \
40 "This file is Free Software under the GNU GPL (v>=2)\n" \
41 "and comes with ABSOLUTELY NO WARRANTY!\n"
42
38 #ifdef Q_OS_WIN 43 #ifdef Q_OS_WIN
39 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin) 44 Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
40 #else 45 #else
41 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin) 46 Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
42 #endif 47 #endif
62 qDebug() << "Application style is: " << app.style()->metaObject()->className(); 67 qDebug() << "Application style is: " << app.style()->metaObject()->className();
63 qDebug() << "Available styles: " << QStyleFactory::keys().join(", "); 68 qDebug() << "Available styles: " << QStyleFactory::keys().join(", ");
64 69
65 QStringList arguments = QApplication::arguments(); 70 QStringList arguments = QApplication::arguments();
66 bool trayMode = arguments.contains("--tray"); 71 bool trayMode = arguments.contains("--tray");
72
73 if (arguments.contains("--version")) {
74 printf (APPNAME " Version: %s \n",
75 QApplication::applicationVersion().toLocal8Bit().constData());
76 printf (COPYRIGHT);
77 return 0;
78 }
67 79
68 QSettings settings; 80 QSettings settings;
69 settings.beginGroup("settings"); 81 settings.beginGroup("settings");
70 bool autoStart = settings.value("autostart", true).toBool(); 82 bool autoStart = settings.value("autostart", true).toBool();
71 settings.endGroup(); 83 settings.endGroup();

http://wald.intevation.org/projects/trustbridge/