diff ui/administrator.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 09077eca0b0d
children 170b13ea05ee
line wrap: on
line diff
--- a/ui/administrator.cpp	Thu Jul 24 11:41:17 2014 +0200
+++ b/ui/administrator.cpp	Thu Jul 24 11:41:52 2014 +0200
@@ -26,6 +26,11 @@
 #define ORGANIZATION "BSI"
 #endif
 
+#define COPYRIGHT "Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik \n" \
+                  "Software engineering by Intevation GmbH \n\n" \
+                  "This file is Free Software under the GNU GPL (v>=2)\n" \
+                  "and comes with ABSOLUTELY NO WARRANTY!\n"
+
 #ifdef Q_OS_WIN
  Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
 #else
@@ -43,6 +48,13 @@
     QApplication::setApplicationVersion(QString::fromLatin1(VERSION));
     QSettings::setDefaultFormat(QSettings::IniFormat);
 
+    if (QApplication::arguments().contains("--version")) {
+        printf (APPNAME " Version: %s \n",
+                QApplication::applicationVersion().toLocal8Bit().constData());
+        printf (COPYRIGHT);
+        return 0;
+    }
+
     QTranslator translator;
     if (QLocale::system().name() == "C") {
         /* Useful for testing / development as the primary target is german */

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