author | zautrix <zautrix> | 2004-07-03 16:12:29 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-03 16:12:29 (UTC) |
commit | a95f7085c5dd7234c254750e32e44941599f3390 (patch) (unidiff) | |
tree | 1631703e01dbf2033394e4b71bc753b562528a67 | |
parent | 9172a6c3325e2de04c72c53cdd760bd1efa46611 (diff) | |
download | kdepimpi-a95f7085c5dd7234c254750e32e44941599f3390.zip kdepimpi-a95f7085c5dd7234c254750e32e44941599f3390.tar.gz kdepimpi-a95f7085c5dd7234c254750e32e44941599f3390.tar.bz2 |
Mainembedded cleaned up
-rw-r--r-- | kaddressbook/mainembedded.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 47b5484..b7d6b2b 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -1,11 +1,10 @@ | |||
1 | #ifndef DESKTOP_VERSION | 1 | #ifndef DESKTOP_VERSION |
2 | #include <qpe/qpeapplication.h> | 2 | #include <qpe/qpeapplication.h> |
3 | #include <qpe/global.h> | ||
4 | #include <stdlib.h> | 3 | #include <stdlib.h> |
5 | #else | 4 | #else |
6 | #include <qapplication.h> | 5 | #include <qapplication.h> |
7 | #include <qwindowsstyle.h> | 6 | #include <qwindowsstyle.h> |
8 | #include <qplatinumstyle.h> | 7 | #include <qplatinumstyle.h> |
9 | #include <qmainwindow.h> | 8 | #include <qmainwindow.h> |
10 | #endif | 9 | #endif |
11 | 10 | ||
@@ -35,48 +34,31 @@ int main( int argc, char **argv ) | |||
35 | printf(" KA/E is exiting now. Bye!\n"); | 34 | printf(" KA/E is exiting now. Bye!\n"); |
36 | exitHelp = true; | 35 | exitHelp = true; |
37 | } | 36 | } |
38 | } | 37 | } |
39 | if ( ! exitHelp ) { | 38 | if ( ! exitHelp ) { |
40 | 39 | ||
41 | KGlobal::setAppName( "kaddressbook" ); | 40 | KGlobal::setAppName( "kaddressbook" ); |
42 | #ifndef DESKTOP_VERSION | 41 | #ifndef DESKTOP_VERSION |
43 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName(); | ||
44 | |||
45 | KStandardDirs::setAppDir( appdir ); | ||
46 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 42 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
47 | #else | 43 | #else |
48 | QString fileName ; | 44 | QString fileName ; |
49 | #ifndef _WIN32_ | 45 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/"; |
50 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; | 46 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
51 | #else | ||
52 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; | ||
53 | #endif | ||
54 | KGlobal::iconLoader()->setIconPath(fileName); | ||
55 | QString appdir = QDir::homeDirPath(); | ||
56 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | ||
57 | appdir += "kaddressbook"; | ||
58 | else | ||
59 | appdir += "/kaddressbook"; | ||
60 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | ||
61 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | ||
62 | #endif // desktop | ||
63 | QDir app_dir; | ||
64 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | ||
65 | app_dir.mkdir (KStandardDirs::appDir()); | ||
66 | 47 | ||
48 | #endif | ||
49 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | ||
67 | KAddressBookMain* m = new KAddressBookMain(); | 50 | KAddressBookMain* m = new KAddressBookMain(); |
68 | //US MainWindow m; | 51 | //US MainWindow m; |
69 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 52 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
70 | 53 | ||
71 | #ifndef DESKTOP_VERSION | 54 | #ifndef DESKTOP_VERSION |
72 | a.showMainWidget(m ); | 55 | a.showMainWidget(m ); |
73 | m->showMaximized(); | 56 | m->showMaximized(); |
74 | |||
75 | #else | 57 | #else |
76 | a.setMainWidget(m ); | 58 | a.setMainWidget(m ); |
77 | m->show(); | 59 | m->show(); |
78 | //m->resize( 640, 480 ); | 60 | //m->resize( 640, 480 ); |
79 | #endif | 61 | #endif |
80 | a.exec(); | 62 | a.exec(); |
81 | 63 | ||
82 | } | 64 | } |