summaryrefslogtreecommitdiffabout
path: root/kaddressbook/mainembedded.cpp
Unidiff
Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 2f3531d..e373105 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,80 +1,79 @@
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 <q3mainwindow.h>
9#include <qmainwindow.h>
10#include <qmessagebox.h> 9#include <qmessagebox.h>
11#include <stdlib.h> 10#include <stdlib.h>
12#endif 11#endif
13 12
14#include <qtextcodec.h> 13#include <qtextcodec.h>
15#include <kstandarddirs.h> 14#include <kstandarddirs.h>
16#include <qregexp.h> 15#include <qregexp.h>
17#include <kglobal.h> 16#include <kglobal.h>
18#include <stdio.h> 17#include <stdio.h>
19#include <qdir.h> 18#include <qdir.h>
20#include "kabprefs.h" 19#include "kabprefs.h"
21#include "kaddressbookmain.h" 20#include "kaddressbookmain.h"
22#include "externalapphandler.h" 21#include "externalapphandler.h"
23#include <libkdepim/kpimglobalprefs.h> 22#include <libkdepim/kpimglobalprefs.h>
24void dumpMissing(); 23void dumpMissing();
25int main( int argc, char **argv ) 24int main( int argc, char **argv )
26{ 25{
26 if(!getenv("QPEDIR")) putenv("QPEDIR=/usr/lib/kdepimpi");
27#ifndef DESKTOP_VERSION 27#ifndef DESKTOP_VERSION
28 QPEApplication a( argc, argv ); 28 QPEApplication a( argc, argv );
29 a.setKeepRunning (); 29 a.setKeepRunning ();
30#else 30#else
31 QApplication a( argc, argv ); 31 QApplication a( argc, argv );
32 QApplication::setStyle( new QPlatinumStyle ());
33#ifdef _WIN32_ 32#ifdef _WIN32_
34 QString hdir ( getenv( "HOME") ); 33 QString hdir ( getenv( "HOME") );
35 if ( hdir.isEmpty() ) { 34 if ( hdir.isEmpty() ) {
36 QString hd ("C:/" ); 35 QString hd ("C:/" );
37 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd ); 36 //QMessageBox::information(0,"hh",QDir::homeDirPath()+" xx" +hd );
38 if ( QDir::homeDirPath().lower() == hd.lower() ) { 37 if ( QDir::homeDirPath().lower() == hd.lower() ) {
39 _putenv( "HOME=C:"); 38 _putenv( "HOME=C:");
40 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) ); 39 //QMessageBox::information(0,"hh",QString ( getenv( "HOME") ) );
41 } 40 }
42 } else { 41 } else {
43 QDir app_dir; 42 QDir app_dir;
44 if ( !app_dir.exists(hdir) ) 43 if ( !app_dir.exists(hdir) )
45 app_dir.mkdir (hdir); 44 app_dir.mkdir (hdir);
46 } 45 }
47#endif 46#endif
48#endif 47#endif
49 48
50 bool exitHelp = false; 49 bool exitHelp = false;
51 if ( argc > 1 ) { 50 if ( argc > 1 ) {
52 QString command = argv[1]; 51 QString command = argv[1];
53 if ( command == "-help" ){ 52 if ( command == "-help" ){
54 printf("KA/E command line commands:\n"); 53 printf("KA/E command line commands:\n");
55 printf(" no command: Start KA/E in usual way\n"); 54 printf(" no command: Start KA/E in usual way\n");
56 printf(" -help: This output\n"); 55 printf(" -help: This output\n");
57 printf(" KA/E is exiting now. Bye!\n"); 56 printf(" KA/E is exiting now. Bye!\n");
58 exitHelp = true; 57 exitHelp = true;
59 } 58 }
60 } 59 }
61 if ( ! exitHelp ) { 60 if ( ! exitHelp ) {
62 61
63 KGlobal::setAppName( "kaddressbook" ); 62 KGlobal::setAppName( "kaddressbook" );
64#ifndef DESKTOP_VERSION 63#ifndef DESKTOP_VERSION
65 if ( QApplication::desktop()->width() > 320 ) 64 if ( QApplication::desktop()->width() > 320 )
66 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 65 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
67 else 66 else
68 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 67 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
69#else 68#else
70 QString fileName ; 69 QString fileName ;
71 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 70 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
72 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 71 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
73 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 72 QApplication::addLibraryPath ( qApp->applicationDirPath () );
74 73
75#endif 74#endif
76 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 75 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
77 // init language 76 // init language
78 KPimGlobalPrefs::instance()->setGlobalConfig(); 77 KPimGlobalPrefs::instance()->setGlobalConfig();
79 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont ); 78 QApplication::setFont( KPimGlobalPrefs::instance()->mApplicationFont );
80 KAddressBookMain m ; 79 KAddressBookMain m ;