X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/blobdiff_plain/68b2df2aae1c3894cb2a720d088b5f41e17a93e1..080dc7d603d45ba0662aa731418993ddd45b5fe8:/src/app/main.cpp diff --git a/src/app/main.cpp b/src/app/main.cpp index aa29694..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,66 +17,37 @@ * 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); - Q_INIT_RESOURCE(maps); Q_INIT_RESOURCE(db); + Q_INIT_RESOURCE(data); Application a(argc, argv); - Application::setWindowIcon(QIcon(":/icons/fosdem.png")); - - SqlEngine::initialize(); // creates "SQLITE" DB connection - - QWidget *window; + 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(); }