first release
[groupsms] / sms / main.cpp
1 #include <QtGui/QApplication>
2 #include "mainwindow.h"
3 #include "contactinterface.h"
4 #include "common.h"
5 #include "item.h"
6
7 #ifdef ONLY_FOR_EBOOK
8
9 #include <gtk/gtk.h>
10
11 #endif
12
13 static void registerTypes()
14 {
15     static bool registered = false;
16     if( !registered )
17     {
18         qRegisterMetaType<Item>();
19         qRegisterMetaType<ItemList>();
20         qRegisterMetaType<ItemListPtr>();
21         registered = true;
22     }
23 }
24
25 int main(int argc, char *argv[])
26 {
27 #ifdef ONLY_FOR_EBOOK
28 //    gtk_init( &argc, &argv );
29
30     /* Initialize the osso context */
31     osso_context_t *osso_context = osso_initialize( "GroupSMS", "1.0", TRUE, NULL );
32     if( !osso_context )
33     {
34         //qDebug() << "Couldn't initialize osso context";
35         return false;
36     }
37
38     /* Initialize abook, which also initializes all the
39              * libraries it needs (GTK+, Galago, Gnome-VFS) */
40     osso_abook_init( &argc, &argv, osso_context);
41 #endif
42
43     QDir dir( QDir::homePath() );
44     dir.mkdir( HOME_DIR );
45
46     QApplication a(argc, argv);
47
48     registerTypes();
49
50 #if defined(Q_WS_S60)
51     MainWindow::getInstance()->show();
52 #else
53     MainWindow::getInstance()->show();
54 #endif
55     return a.exec();
56 }