X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/babe4cd4d181fcb2f63a8ae0928c5bf69e831c31..080dc7d603d45ba0662aa731418993ddd45b5fe8:/src/app/main.cpp diff --git a/src/app/main.cpp b/src/app/main.cpp index 0d450f6..e67abfb 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2010 Ixonos Plc. - * Copyright (C) 2011 Philipp Spitzer, gregor herrmann + * Copyright (C) 2011-2024 Philipp Spitzer, gregor herrmann, Stefan Stahl * * This file is part of ConfClerk. * @@ -17,20 +17,13 @@ * You should have received a copy of the GNU General Public License along with * ConfClerk. If not, see . */ -#include +#include "mainwindow.h" -#include +#include "sqlengine.h" #include "eventdialog.h" #include "application.h" -#ifdef MAEMO -//#include -#include -#include -#endif /* MAEMO */ - - int main(int argc, char *argv[]) { Q_INIT_RESOURCE(icons); @@ -43,44 +36,18 @@ int main(int argc, char *argv[]) // needed by QDesktopServices QCoreApplication::setOrganizationName("Toastfreeware"); QCoreApplication::setApplicationName("ConfClerk"); - - SqlEngine::initialize(); // creates "SQLITE" DB connection - - QWidget *window; - - window = new MainWindow; + QCoreApplication::setApplicationVersion(VERSION); + MainWindow window; -#ifdef MAEMO - // Alarm Dbus - CAlarmDBus *alarmDBus = new CAlarmDBus(window); - new AlarmDBusAdaptor(alarmDBus); - QDBusConnection connection = QDBusConnection::sessionBus(); - - if(connection.registerObject("/ConfClerk", alarmDBus) == true) - { - if( connection.registerService("at.priv.toastfreeware.confclerk") == false) - { - if(argc>1) - { - QDBusInterface *interface = new QDBusInterface("at.priv.toastfreeware.confclerk", - "/ConfClerk", - "at.priv.toastfreeware.confclerk.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(); }