source: src/app/main.cpp @ 69820d8

qt5
Last change on this file since 69820d8 was 69820d8, checked in by pavelpa <pavelpa@…>, 12 years ago

compilation error fix

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[e5bc908]1#include <mainwindow.h>
2
3#include <QtGui/QApplication>
[0f86a19]4#ifdef MAEMO
[6831c6a]5//#include <alarmdialog.h>
[69820d8]6#include <alarmdbus.h>
7#include <alarmdbusadaptorp.h>
[0f86a19]8#endif /* MAEMO */
[e5bc908]9
[05afe5f]10#include <sqlengine.h>
11
[6831c6a]12
[e5bc908]13int main(int argc, char *argv[])
14{
[f0ce4d0]15    Q_INIT_RESOURCE(icons);
[2fc2878]16    Q_INIT_RESOURCE(maps);
[979e5be]17    Q_INIT_RESOURCE(db);
[f0ce4d0]18
[e5bc908]19    QApplication a(argc, argv);
[f0ce4d0]20    QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
[e5bc908]21
[3a8dc71]22    SqlEngine::initialize(); // creates "SQLITE" DB connection
[05afe5f]23
[6bd729b]24    QWidget *window;
25#ifdef MAEMO
26    // if the app is run with two cmd-line arguments
27    // an alarm dialog is to be displayed
28    // Usage: $ ./fosdem eventId alarmId
29    // Example: $ ./fosdem 521 13
[6831c6a]30//    if(argc==3)
31//        window = new AlarmDialog(argc,argv);
32//    else if(argc==2) // display Event dialog automatically
33//        window = new MainWindow(atoi(argv[1])); // eventId = argv[1]
34//    else
[6bd729b]35        window = new MainWindow;
36#else
37    window = new MainWindow;
38#endif /* MAEMO */
39    window->show();
[6831c6a]40
[0f86a19]41#ifdef MAEMO
[6831c6a]42    // Alarm Dbus
43    CAlarmDBus *alarmDBus = new CAlarmDBus(window);
44    new AlarmDBusAdaptor(alarmDBus);
45    //QDBusConnection connection = QDBusConnection::sessionBus();
46    QDBusConnection connection = QDBusConnection::sessionBus();
47
48    if(connection.registerObject("/Fosdem", alarmDBus) == true)
49    {
50        if( connection.registerService("org.fosdem.schedule") == false)
51        {
52                qDebug() << "dbus register service failed";
53        }
54    }
[0f86a19]55#endif
[6831c6a]56
[e5bc908]57    return a.exec();
58}
[f0ce4d0]59
Note: See TracBrowser for help on using the repository browser.