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