summaryrefslogtreecommitdiffabout
path: root/kaddressbook/mainembedded.cpp
Unidiff
Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 6dd97b8..a2ff1e9 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -34,107 +34,104 @@ int main( int argc, char **argv )
34 QDir app_dir; 34 QDir app_dir;
35 if ( !app_dir.exists("C:\\kdepim") ) 35 if ( !app_dir.exists("C:\\kdepim") )
36 app_dir.mkdir ("C:\\kdepim"); 36 app_dir.mkdir ("C:\\kdepim");
37 if ( !app_dir.exists("C:\\kdepim\\apps") ) 37 if ( !app_dir.exists("C:\\kdepim\\apps") )
38 app_dir.mkdir ("C:\\kdepim\\apps"); 38 app_dir.mkdir ("C:\\kdepim\\apps");
39 if ( !app_dir.exists("C:\\kdepim\\config") ) 39 if ( !app_dir.exists("C:\\kdepim\\config") )
40 app_dir.mkdir ("C:\\kdepim\\config"); 40 app_dir.mkdir ("C:\\kdepim\\config");
41 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") ) 41 if ( !app_dir.exists("C:\\kdepim\\apps\\kaddressbook") )
42 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook"); 42 app_dir.mkdir ("C:\\kdepim\\apps\\kaddressbook");
43 } 43 }
44#endif 44#endif
45 45
46 bool exitHelp = false; 46 bool exitHelp = false;
47 if ( argc > 1 ) { 47 if ( argc > 1 ) {
48 QString command = argv[1]; 48 QString command = argv[1];
49 if ( command == "-help" ){ 49 if ( command == "-help" ){
50 printf("KA/E command line commands:\n"); 50 printf("KA/E command line commands:\n");
51 printf(" no command: Start KA/E in usual way\n"); 51 printf(" no command: Start KA/E in usual way\n");
52 printf(" -help: This output\n"); 52 printf(" -help: This output\n");
53 printf(" KA/E is exiting now. Bye!\n"); 53 printf(" KA/E is exiting now. Bye!\n");
54 exitHelp = true; 54 exitHelp = true;
55 } 55 }
56 } 56 }
57 if ( ! exitHelp ) { 57 if ( ! exitHelp ) {
58 58
59 KGlobal::setAppName( "kaddressbook" ); 59 KGlobal::setAppName( "kaddressbook" );
60#ifndef DESKTOP_VERSION 60#ifndef DESKTOP_VERSION
61 if ( QApplication::desktop()->width() > 320 ) 61 if ( QApplication::desktop()->width() > 320 )
62 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 62 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
63 else 63 else
64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 64 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
65#else 65#else
66 QString fileName ; 66 QString fileName ;
67 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; 67 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/";
68 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 68 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
69 QApplication::addLibraryPath ( qApp->applicationDirPath () ); 69 QApplication::addLibraryPath ( qApp->applicationDirPath () );
70 70
71#endif 71#endif
72 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 72 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
73 KAddressBookMain m ; 73 KAddressBookMain m ;
74//US MainWindow m; 74//US MainWindow m;
75 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 75 QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
76 76
77 { 77 {
78 KPimGlobalPrefs::instance()->setGlobalConfig(); 78 KPimGlobalPrefs::instance()->setGlobalConfig();
79 } 79 }
80#ifndef DESKTOP_VERSION 80#ifndef DESKTOP_VERSION
81 a.showMainWidget( &m ); 81 a.showMainWidget( &m );
82 QCopChannel* c1 = new QCopChannel("QPE/Application/addressbook",&m, "channelAB" ) ; 82
83 QObject::connect( c1, SIGNAL (received ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
84#else 83#else
85 a.setMainWidget( &m ); 84 a.setMainWidget( &m );
86 m.resize (640, 480 ); 85 m.resize (640, 480 );
87 m.show(); 86 m.show();
88#endif 87#endif
89 a.exec(); 88 a.exec();
90#ifndef DESKTOP_VERSION 89
91 delete c1;
92#endif
93 90
94 } 91 }
95 qDebug("KA: Bye! "); 92 qDebug("KA: Bye! ");
96} 93}
97 94
98/* 95/*
99#include <stdlib.h> 96#include <stdlib.h>
100 97
101#include <qstring.h> 98#include <qstring.h>
102 99
103#include <kabc/stdaddressbook.h> 100#include <kabc/stdaddressbook.h>
104#include <kaboutdata.h> 101#include <kaboutdata.h>
105#include <kcmdlineargs.h> 102#include <kcmdlineargs.h>
106#include <kcrash.h> 103#include <kcrash.h>
107#include <kdebug.h> 104#include <kdebug.h>
108#include <klocale.h> 105#include <klocale.h>
109#include <kstartupinfo.h> 106#include <kstartupinfo.h>
110#include <kuniqueapplication.h> 107#include <kuniqueapplication.h>
111#include <kwin.h> 108#include <kwin.h>
112 109
113#include "kaddressbookmain.h" 110#include "kaddressbookmain.h"
114#include "kabcore.h" 111#include "kabcore.h"
115 112
116extern "C" { 113extern "C" {
117 114
118void crashHandler( int ) 115void crashHandler( int )
119{ 116{
120 KABC::StdAddressBook::handleCrash(); 117 KABC::StdAddressBook::handleCrash();
121 ::exit( 0 ); 118 ::exit( 0 );
122} 119}
123 120
124} 121}
125 122
126class KAddressBookApp : public KUniqueApplication { 123class KAddressBookApp : public KUniqueApplication {
127 public: 124 public:
128 KAddressBookApp() : mMainWin( 0 ) {} 125 KAddressBookApp() : mMainWin( 0 ) {}
129 ~KAddressBookApp() {} 126 ~KAddressBookApp() {}
130 127
131 int newInstance(); 128 int newInstance();
132 129
133 private: 130 private:
134 KAddressBookMain *mMainWin; 131 KAddressBookMain *mMainWin;
135}; 132};
136 133
137int KAddressBookApp::newInstance() 134int KAddressBookApp::newInstance()
138{ 135{
139 if ( isRestored() ) { 136 if ( isRestored() ) {
140 // There can only be one main window 137 // There can only be one main window