source: src/app/main.cpp @ b4e9936

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

compilation error fix

  • Property mode set to 100644
File size: 1.4 KB
Line 
1#include <mainwindow.h>
2
3#include <QtGui/QApplication>
4#ifdef MAEMO
5//#include <alarmdialog.h>
6#include <alarmdbus.h>
7#include <alarmdbusadaptorp.h>
8#endif /* MAEMO */
9
10#include <sqlengine.h>
11
12
13int main(int argc, char *argv[])
14{
15    Q_INIT_RESOURCE(icons);
16    Q_INIT_RESOURCE(maps);
17    Q_INIT_RESOURCE(db);
18
19    QApplication a(argc, argv);
20    QApplication::setWindowIcon(QIcon(":/icons/fosdem.png"));
21
22    SqlEngine::initialize(); // creates "SQLITE" DB connection
23
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
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
35        window = new MainWindow;
36#else
37    window = new MainWindow;
38#endif /* MAEMO */
39    window->show();
40
41#ifdef MAEMO
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    }
55#endif
56
57    return a.exec();
58}
59
Note: See TracBrowser for help on using the repository browser.