-rw-r--r-- | kmicromail/main.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/kmicromail/main.cpp b/kmicromail/main.cpp new file mode 100644 index 0000000..f2879e8 --- a/dev/null +++ b/kmicromail/main.cpp | |||
@@ -0,0 +1,55 @@ | |||
1 | |||
2 | #ifndef DESKTOP_VERSION | ||
3 | #include <qpe/qpeapplication.h> | ||
4 | #include <stdlib.h> | ||
5 | #else | ||
6 | #include <qapplication.h> | ||
7 | #include <qstring.h> | ||
8 | #include <qwindowsstyle.h> | ||
9 | #include <qplatinumstyle.h> | ||
10 | #include <qsgistyle.h> | ||
11 | #endif | ||
12 | #include "opiemail.h" | ||
13 | #include <qdir.h> | ||
14 | #include <kstandarddirs.h> | ||
15 | #include <kglobal.h> | ||
16 | #include <stdio.h> | ||
17 | #include "mainwindow.h" | ||
18 | |||
19 | using namespace Opie::Core; | ||
20 | int main( int argc, char **argv ) { | ||
21 | |||
22 | #ifndef DESKTOP_VERSION | ||
23 | QPEApplication a( argc, argv ); | ||
24 | a.setKeepRunning (); | ||
25 | #else | ||
26 | QApplication a( argc, argv ); | ||
27 | QApplication::setStyle( new QPlatinumStyle ()); | ||
28 | #endif | ||
29 | |||
30 | KGlobal::setAppName( "kmicromail" ); | ||
31 | QString fileName ; | ||
32 | #ifndef DESKTOP_VERSION | ||
33 | fileName = getenv("QPEDIR"); | ||
34 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/kmicromail/"); | ||
35 | #else | ||
36 | fileName = qApp->applicationDirPath () + "/kdepim/kmicromail/"; | ||
37 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | ||
38 | #endif | ||
39 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kmicromail"))); | ||
40 | OpieMail* mw = new OpieMail(); | ||
41 | #ifndef DESKTOP_VERSION | ||
42 | //qDebug("CONNECT "); | ||
43 | QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),mw, SLOT(message( const QCString&, const QByteArray& ))); | ||
44 | a.showMainWidget(mw ); | ||
45 | #else | ||
46 | a.setMainWidget(mw ); | ||
47 | m.show(); | ||
48 | //m.resize( 800, 600 ); | ||
49 | #endif | ||
50 | QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); | ||
51 | int rv = a.exec(); | ||
52 | delete mw; | ||
53 | return rv; | ||
54 | |||
55 | } | ||