Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/mainembedded.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 7f368eb..850e5b2 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -1,41 +1,42 @@ | |||
1 | #ifndef DESKTOP_VERSION | 1 | #ifndef DESKTOP_VERSION |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #else | 4 | #else |
5 | #include <qapplication.h> | 5 | #include <qapplication.h> |
6 | #include <qwindowsstyle.h> | 6 | #include <qwindowsstyle.h> |
7 | #include <qplatinumstyle.h> | 7 | #include <qplatinumstyle.h> |
8 | #include <qmainwindow.h> | 8 | #include <qmainwindow.h> |
9 | #endif | 9 | #endif |
10 | 10 | ||
11 | #include <kstandarddirs.h> | 11 | #include <kstandarddirs.h> |
12 | #include <kglobal.h> | 12 | #include <kglobal.h> |
13 | #include <stdio.h> | 13 | #include <stdio.h> |
14 | #include <qdir.h> | 14 | #include <qdir.h> |
15 | #include "kaddressbookmain.h" | 15 | #include "kaddressbookmain.h" |
16 | #include "externalapphandler.h" | ||
16 | 17 | ||
17 | int main( int argc, char **argv ) | 18 | int main( int argc, char **argv ) |
18 | { | 19 | { |
19 | #ifndef DESKTOP_VERSION | 20 | #ifndef DESKTOP_VERSION |
20 | QPEApplication a( argc, argv ); | 21 | QPEApplication a( argc, argv ); |
21 | a.setKeepRunning (); | 22 | a.setKeepRunning (); |
22 | #else | 23 | #else |
23 | QApplication a( argc, argv ); | 24 | QApplication a( argc, argv ); |
24 | QApplication::setStyle( new QPlatinumStyle ()); | 25 | QApplication::setStyle( new QPlatinumStyle ()); |
25 | #endif | 26 | #endif |
26 | 27 | ||
27 | bool exitHelp = false; | 28 | bool exitHelp = false; |
28 | if ( argc > 1 ) { | 29 | if ( argc > 1 ) { |
29 | QString command = argv[1]; | 30 | QString command = argv[1]; |
30 | if ( command == "-help" ){ | 31 | if ( command == "-help" ){ |
31 | printf("KA/E command line commands:\n"); | 32 | printf("KA/E command line commands:\n"); |
32 | printf(" no command: Start KA/E in usual way\n"); | 33 | printf(" no command: Start KA/E in usual way\n"); |
33 | printf(" -help: This output\n"); | 34 | printf(" -help: This output\n"); |
34 | printf(" KA/E is exiting now. Bye!\n"); | 35 | printf(" KA/E is exiting now. Bye!\n"); |
35 | exitHelp = true; | 36 | exitHelp = true; |
36 | } | 37 | } |
37 | } | 38 | } |
38 | if ( ! exitHelp ) { | 39 | if ( ! exitHelp ) { |
39 | 40 | ||
40 | KGlobal::setAppName( "kaddressbook" ); | 41 | KGlobal::setAppName( "kaddressbook" ); |
41 | #ifndef DESKTOP_VERSION | 42 | #ifndef DESKTOP_VERSION |
@@ -44,31 +45,31 @@ int main( int argc, char **argv ) | |||
44 | else | 45 | else |
45 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 46 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
46 | #else | 47 | #else |
47 | QString fileName ; | 48 | QString fileName ; |
48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 49 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
49 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 50 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
50 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 51 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
51 | 52 | ||
52 | #endif | 53 | #endif |
53 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 54 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
54 | KAddressBookMain m ; | 55 | KAddressBookMain m ; |
55 | //US MainWindow m; | 56 | //US MainWindow m; |
56 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 57 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
57 | 58 | ||
58 | #ifndef DESKTOP_VERSION | 59 | #ifndef DESKTOP_VERSION |
59 | a.showMainWidget( &m ); | 60 | a.showMainWidget( &m ); |
60 | #else | 61 | #else |
61 | a.setMainWidget( &m ); | 62 | a.setMainWidget( &m ); |
62 | m.resize (640, 480 ); | 63 | m.resize (640, 480 ); |
63 | m.show(); | 64 | m.show(); |
64 | #endif | 65 | #endif |
65 | a.exec(); | 66 | a.exec(); |
66 | 67 | ||
67 | } | 68 | } |
68 | qDebug("KA: Bye! "); | 69 | qDebug("KA: Bye! "); |
69 | } | 70 | } |
70 | 71 | ||
71 | /* | 72 | /* |
72 | #include <stdlib.h> | 73 | #include <stdlib.h> |
73 | 74 | ||
74 | #include <qstring.h> | 75 | #include <qstring.h> |