summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 3f6f69d..47b5484 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,107 +1,109 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <qpe/global.h> 3#include <qpe/global.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 <kstandarddirs.h> 12#include <kstandarddirs.h>
13#include <kglobal.h> 13#include <kglobal.h>
14#include <stdio.h> 14#include <stdio.h>
15#include <qdir.h> 15#include <qdir.h>
16#include "kaddressbookmain.h" 16#include "kaddressbookmain.h"
17 17
18int main( int argc, char **argv ) 18int main( int argc, char **argv )
19{ 19{
20#ifndef DESKTOP_VERSION 20#ifndef DESKTOP_VERSION
21 QPEApplication a( argc, argv ); 21 QPEApplication a( argc, argv );
22 a.setKeepRunning (); 22 a.setKeepRunning ();
23#else 23#else
24 QApplication a( argc, argv ); 24 QApplication a( argc, argv );
25 QApplication::setStyle( new QPlatinumStyle ()); 25 QApplication::setStyle( new QPlatinumStyle ());
26#endif 26#endif
27 27
28 bool exitHelp = false; 28 bool exitHelp = false;
29 if ( argc > 1 ) { 29 if ( argc > 1 ) {
30 QString command = argv[1]; 30 QString command = argv[1];
31 if ( command == "-help" ){ 31 if ( command == "-help" ){
32 printf("KA/E command line commands:\n"); 32 printf("KA/E command line commands:\n");
33 printf(" no command: Start KA/E in usual way\n"); 33 printf(" no command: Start KA/E in usual way\n");
34 printf(" -help: This output\n"); 34 printf(" -help: This output\n");
35 printf(" KA/E is exiting now. Bye!\n"); 35 printf(" KA/E is exiting now. Bye!\n");
36 exitHelp = true; 36 exitHelp = true;
37 } 37 }
38 } 38 }
39 if ( ! exitHelp ) { 39 if ( ! exitHelp ) {
40 40
41 KGlobal::setAppName( "kaddressbook" ); 41 KGlobal::setAppName( "kaddressbook" );
42#ifndef DESKTOP_VERSION 42#ifndef DESKTOP_VERSION
43 KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); 43 QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName();
44
45 KStandardDirs::setAppDir( appdir );
44 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 46 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
45#else 47#else
46 QString fileName ; 48 QString fileName ;
47#ifndef _WIN32_ 49#ifndef _WIN32_
48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; 50 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/";
49#else 51#else
50 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; 52 fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\";
51#endif 53#endif
52 KGlobal::iconLoader()->setIconPath(fileName); 54 KGlobal::iconLoader()->setIconPath(fileName);
53 QString appdir = QDir::homeDirPath(); 55 QString appdir = QDir::homeDirPath();
54 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) 56 if ( appdir.right(1) == "\\" || appdir.right(1) == "/" )
55 appdir += "kaddressbook"; 57 appdir += "kaddressbook";
56 else 58 else
57 appdir += "/kaddressbook"; 59 appdir += "/kaddressbook";
58 KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); 60 KStandardDirs::setAppDir( QDir::convertSeparators( appdir ));
59 // qDebug(" %s ",KStandardDirs::appDir().latin1() ); 61 // qDebug(" %s ",KStandardDirs::appDir().latin1() );
60#endif // desktop 62#endif // desktop
61 QDir app_dir; 63 QDir app_dir;
62 if ( !app_dir.exists(KStandardDirs::appDir()) ) 64 if ( !app_dir.exists(KStandardDirs::appDir()) )
63 app_dir.mkdir (KStandardDirs::appDir()); 65 app_dir.mkdir (KStandardDirs::appDir());
64 66
65 KAddressBookMain* m = new KAddressBookMain(); 67 KAddressBookMain* m = new KAddressBookMain();
66//US MainWindow m; 68//US MainWindow m;
67//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 69//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
68 70
69#ifndef DESKTOP_VERSION 71#ifndef DESKTOP_VERSION
70 a.showMainWidget(m ); 72 a.showMainWidget(m );
71 m->showMaximized(); 73 m->showMaximized();
72 74
73#else 75#else
74 a.setMainWidget(m ); 76 a.setMainWidget(m );
75 m->show(); 77 m->show();
76 //m->resize( 640, 480 ); 78 //m->resize( 640, 480 );
77#endif 79#endif
78 a.exec(); 80 a.exec();
79 81
80 } 82 }
81 qDebug("KA: Bye! "); 83 qDebug("KA: Bye! ");
82} 84}
83 85
84/* 86/*
85#include <stdlib.h> 87#include <stdlib.h>
86 88
87#include <qstring.h> 89#include <qstring.h>
88 90
89#include <kabc/stdaddressbook.h> 91#include <kabc/stdaddressbook.h>
90#include <kaboutdata.h> 92#include <kaboutdata.h>
91#include <kcmdlineargs.h> 93#include <kcmdlineargs.h>
92#include <kcrash.h> 94#include <kcrash.h>
93#include <kdebug.h> 95#include <kdebug.h>
94#include <klocale.h> 96#include <klocale.h>
95#include <kstartupinfo.h> 97#include <kstartupinfo.h>
96#include <kuniqueapplication.h> 98#include <kuniqueapplication.h>
97#include <kwin.h> 99#include <kwin.h>
98 100
99#include "kaddressbookmain.h" 101#include "kaddressbookmain.h"
100#include "kabcore.h" 102#include "kabcore.h"
101 103
102extern "C" { 104extern "C" {
103 105
104void crashHandler( int ) 106void crashHandler( int )
105{ 107{
106 KABC::StdAddressBook::handleCrash(); 108 KABC::StdAddressBook::handleCrash();
107 ::exit( 0 ); 109 ::exit( 0 );