]> ToastFreeware Gitweb - toast/confclerk.git/blobdiff - src/app/main.cpp
Bump copyright years.
[toast/confclerk.git] / src / app / main.cpp
index 777a0fc9583a9cea443346be7c7d21ea868452ea..e67abfb5e92b2b732eca2c1acae87aba459fe41b 100644 (file)
@@ -1,81 +1,53 @@
 /*
  * Copyright (C) 2010 Ixonos Plc.
+ * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl
  *
- * This file is part of fosdem-schedule.
+ * This file is part of ConfClerk.
  *
- * fosdem-schedule is free software: you can redistribute it and/or modify it
+ * ConfClerk is free software: you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation, either version 2 of the License, or (at your option)
  * any later version.
  *
- * fosdem-schedule is distributed in the hope that it will be useful, but
+ * ConfClerk is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
  * You should have received a copy of the GNU General Public License along with
- * fosdem-schedule.  If not, see <http://www.gnu.org/licenses/>.
+ * ConfClerk.  If not, see <http://www.gnu.org/licenses/>.
  */
-#include <mainwindow.h>
+#include "mainwindow.h"
 
-#include <QtGui/QApplication>
-#include <sqlengine.h>
+#include "sqlengine.h"
 
 #include "eventdialog.h"
-
-#ifdef MAEMO
-//#include <alarmdialog.h>
-#include <alarmdbus.h>
-#include <alarmdbusadaptorp.h>
-#endif /* MAEMO */
-
+#include "application.h"
 
 int main(int argc, char *argv[])
 {
     Q_INIT_RESOURCE(icons);
-    Q_INIT_RESOURCE(maps);
     Q_INIT_RESOURCE(db);
+    Q_INIT_RESOURCE(data);
 
-    QApplication a(argc, argv);
-    QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
-
-    SqlEngine::initialize(); // creates "SQLITE" DB connection
-
-    QWidget *window;
+    Application a(argc, argv);
+    Application::setWindowIcon(QIcon(":/confclerk.svg"));
 
-    window = new MainWindow;
+    // needed by QDesktopServices
+    QCoreApplication::setOrganizationName("Toastfreeware");
+    QCoreApplication::setApplicationName("ConfClerk");
+    QCoreApplication::setApplicationVersion(VERSION);
 
+    MainWindow window;
 
-#ifdef MAEMO
-    // Alarm Dbus
-    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
-    new AlarmDBusAdaptor(alarmDBus);
-    QDBusConnection connection = QDBusConnection::sessionBus();
-
-    if(connection.registerObject("/Fosdem", alarmDBus) == true)
-    {
-       if( connection.registerService("org.fosdem.schedule") == false)
-       {
-               if(argc>1)
-               {
-                       QDBusInterface *interface = new QDBusInterface("org.fosdem.schedule",
-                                                                      "/Fosdem",
-                                                                      "org.fosdem.schedule.AlarmInterface",
-                                                                      connection);
-                       interface->call("Alarm",atoi(argv[1]));
-                       return 0;
-               }
-       }
-    }
-
-    if(argc > 1)
-    {
-        EventDialog dialog(atoi(argv[1]),window);
+    // If we were started with the parameters confernceid and eventid, show the corresponding event (alarm)
+    if (argc >= 3) {
+        QString conferenceIdStr = argv[1];
+        QString eventIdStr = argv[2];
+        EventDialog dialog(conferenceIdStr.toInt(), eventIdStr.toInt(), &window);
         dialog.exec();
     }
-#endif
-
-    window->show();
+    window.show();
 
     return a.exec();
 }