Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/mainembedded.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 40089a1..a8816f9 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -1,95 +1,99 @@ | |||
1 | #ifndef DESKTOP_VERSION | 1 | #ifndef DESKTOP_VERSION |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qcopchannel_qws.h> | 3 | #include <qcopchannel_qws.h> |
4 | #include <stdlib.h> | 4 | #include <stdlib.h> |
5 | #else | 5 | #else |
6 | #include <qapplication.h> | 6 | #include <qapplication.h> |
7 | #include <qwindowsstyle.h> | 7 | #include <qwindowsstyle.h> |
8 | #include <qplatinumstyle.h> | 8 | #include <qplatinumstyle.h> |
9 | #include <qmainwindow.h> | 9 | #include <qmainwindow.h> |
10 | #endif | 10 | #endif |
11 | 11 | ||
12 | #include <qtextcodec.h> | 12 | #include <qtextcodec.h> |
13 | #include <kstandarddirs.h> | 13 | #include <kstandarddirs.h> |
14 | #include <qregexp.h> | 14 | #include <qregexp.h> |
15 | #include <kglobal.h> | 15 | #include <kglobal.h> |
16 | #include <stdio.h> | 16 | #include <stdio.h> |
17 | #include <qdir.h> | 17 | #include <qdir.h> |
18 | #include "kabprefs.h" | ||
18 | #include "kaddressbookmain.h" | 19 | #include "kaddressbookmain.h" |
19 | #include "externalapphandler.h" | 20 | #include "externalapphandler.h" |
20 | #include <libkdepim/kpimglobalprefs.h> | 21 | #include <libkdepim/kpimglobalprefs.h> |
21 | 22 | void dumpMissing(); | |
22 | int main( int argc, char **argv ) | 23 | int main( int argc, char **argv ) |
23 | { | 24 | { |
24 | #ifndef DESKTOP_VERSION | 25 | #ifndef DESKTOP_VERSION |
25 | QPEApplication a( argc, argv ); | 26 | QPEApplication a( argc, argv ); |
26 | a.setKeepRunning (); | 27 | a.setKeepRunning (); |
27 | #else | 28 | #else |
28 | QApplication a( argc, argv ); | 29 | QApplication a( argc, argv ); |
29 | QApplication::setStyle( new QPlatinumStyle ()); | 30 | QApplication::setStyle( new QPlatinumStyle ()); |
30 | QString hdir = QDir::homeDirPath(); | 31 | QString hdir = QDir::homeDirPath(); |
31 | // there is a bug when creating dirs for WIN 98 | 32 | // there is a bug when creating dirs for WIN 98 |
32 | // it is difficult to fix, because we have no WIN 98 runnung | 33 | // it is difficult to fix, because we have no WIN 98 runnung |
33 | // such that we try it to create the dirs at startup here | 34 | // such that we try it to create the dirs at startup here |
34 | if ( hdir == "C:\\" ) { // win 98 or ME | 35 | if ( hdir == "C:\\" ) { // win 98 or ME |
35 | QDir app_dir; | 36 | QDir app_dir; |
36 | if ( !app_dir.exists("C:\\kdepim") ) | 37 | if ( !app_dir.exists("C:\\kdepim") ) |
37 | app_dir.mkdir ("C:\\kdepim"); | 38 | app_dir.mkdir ("C:\\kdepim"); |
38 | if ( !app_dir.exists("C:\\kdepim\\apps") ) | 39 | if ( !app_dir.exists("C:\\kdepim\\apps") ) |
39 | app_dir.mkdir ("C:\\kdepim\\apps"); | 40 | app_dir.mkdir ("C:\\kdepim\\apps"); |
40 | if ( !app_dir.exists("C:\\kdepim\\config") ) | 41 | if ( !app_dir.exists("C:\\kdepim\\config") ) |
41 | app_dir.mkdir ("C:\\kdepim\\config"); | 42 | app_dir.mkdir ("C:\\kdepim\\config"); |
42 | if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) | 43 | if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) |
43 | app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); | 44 | app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); |
44 | } | 45 | } |
45 | #endif | 46 | #endif |
46 | 47 | ||
47 | bool exitHelp = false; | 48 | bool exitHelp = false; |
48 | if ( argc > 1 ) { | 49 | if ( argc > 1 ) { |
49 | QString command = argv[1]; | 50 | QString command = argv[1]; |
50 | if ( command == "-help" ){ | 51 | if ( command == "-help" ){ |
51 | printf("KA/E command line commands:\n"); | 52 | printf("KA/E command line commands:\n"); |
52 | printf(" no command: Start KA/E in usual way\n"); | 53 | printf(" no command: Start KA/E in usual way\n"); |
53 | printf(" -help: This output\n"); | 54 | printf(" -help: This output\n"); |
54 | printf(" KA/E is exiting now. Bye!\n"); | 55 | printf(" KA/E is exiting now. Bye!\n"); |
55 | exitHelp = true; | 56 | exitHelp = true; |
56 | } | 57 | } |
57 | } | 58 | } |
58 | if ( ! exitHelp ) { | 59 | if ( ! exitHelp ) { |
59 | 60 | ||
60 | KGlobal::setAppName( "kaddressbook" ); | 61 | KGlobal::setAppName( "kaddressbook" ); |
61 | #ifndef DESKTOP_VERSION | 62 | #ifndef DESKTOP_VERSION |
62 | if ( QApplication::desktop()->width() > 320 ) | 63 | if ( QApplication::desktop()->width() > 320 ) |
63 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); | 64 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); |
64 | else | 65 | else |
65 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 66 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
66 | #else | 67 | #else |
67 | QString fileName ; | 68 | QString fileName ; |
68 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 69 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
69 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 70 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
70 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 71 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
71 | 72 | ||
72 | #endif | 73 | #endif |
73 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 74 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
75 | // init language | ||
76 | KABPrefs::instance(); | ||
74 | KAddressBookMain m ; | 77 | KAddressBookMain m ; |
75 | //US MainWindow m; | 78 | //US MainWindow m; |
76 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 79 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
77 | 80 | ||
78 | { | 81 | { |
79 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 82 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
80 | } | 83 | } |
81 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
82 | a.showMainWidget( &m ); | 85 | a.showMainWidget( &m ); |
83 | 86 | ||
84 | #else | 87 | #else |
85 | a.setMainWidget( &m ); | 88 | a.setMainWidget( &m ); |
86 | m.resize (640, 480 ); | 89 | m.resize (640, 480 ); |
87 | m.show(); | 90 | m.show(); |
88 | #endif | 91 | #endif |
89 | a.exec(); | 92 | a.exec(); |
90 | 93 | ||
94 | dumpMissing(); | ||
91 | 95 | ||
92 | } | 96 | } |
93 | qDebug("KA: Bye! "); | 97 | qDebug("KA: Bye! "); |
94 | } | 98 | } |
95 | 99 | ||