summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2004-07-05 08:15:56 (UTC)
committer zautrix <zautrix>2004-07-05 08:15:56 (UTC)
commit9f0d4ee43ce6f8c61abbd546376ef4f262261a1e (patch) (unidiff)
tree4484ee12251cc858c3130271e5a798f4302be888 /kaddressbook
parent25671b4735f2604e13f4d6801b96f016ac8b9834 (diff)
downloadkdepimpi-9f0d4ee43ce6f8c61abbd546376ef4f262261a1e.zip
kdepimpi-9f0d4ee43ce6f8c61abbd546376ef4f262261a1e.tar.gz
kdepimpi-9f0d4ee43ce6f8c61abbd546376ef4f262261a1e.tar.bz2
Found and fixed problem of fastload of KAPI
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index c127601..dce6a88 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -1,127 +1,125 @@
1#ifndef DESKTOP_VERSION 1#ifndef DESKTOP_VERSION
2#include <qpe/qpeapplication.h> 2#include <qpe/qpeapplication.h>
3#include <stdlib.h> 3#include <stdlib.h>
4#else 4#else
5#include <qapplication.h> 5#include <qapplication.h>
6#include <qwindowsstyle.h> 6#include <qwindowsstyle.h>
7#include <qplatinumstyle.h> 7#include <qplatinumstyle.h>
8#include <qmainwindow.h> 8#include <qmainwindow.h>
9#endif 9#endif
10 10
11#include <kstandarddirs.h> 11#include <kstandarddirs.h>
12#include <kglobal.h> 12#include <kglobal.h>
13#include <stdio.h> 13#include <stdio.h>
14#include <qdir.h> 14#include <qdir.h>
15#include "kaddressbookmain.h" 15#include "kaddressbookmain.h"
16 16
17int main( int argc, char **argv ) 17int main( int argc, char **argv )
18{ 18{
19#ifndef DESKTOP_VERSION 19#ifndef DESKTOP_VERSION
20 QPEApplication a( argc, argv ); 20 QPEApplication a( argc, argv );
21 a.setKeepRunning (); 21 a.setKeepRunning ();
22#else 22#else
23 QApplication a( argc, argv ); 23 QApplication a( argc, argv );
24 QApplication::setStyle( new QPlatinumStyle ()); 24 QApplication::setStyle( new QPlatinumStyle ());
25#endif 25#endif
26 26
27 bool exitHelp = false; 27 bool exitHelp = false;
28 if ( argc > 1 ) { 28 if ( argc > 1 ) {
29 QString command = argv[1]; 29 QString command = argv[1];
30 if ( command == "-help" ){ 30 if ( command == "-help" ){
31 printf("KA/E command line commands:\n"); 31 printf("KA/E command line commands:\n");
32 printf(" no command: Start KA/E in usual way\n"); 32 printf(" no command: Start KA/E in usual way\n");
33 printf(" -help: This output\n"); 33 printf(" -help: This output\n");
34 printf(" KA/E is exiting now. Bye!\n"); 34 printf(" KA/E is exiting now. Bye!\n");
35 exitHelp = true; 35 exitHelp = true;
36 } 36 }
37 } 37 }
38 if ( ! exitHelp ) { 38 if ( ! exitHelp ) {
39 39
40 KGlobal::setAppName( "kaddressbook" ); 40 KGlobal::setAppName( "kaddressbook" );
41#ifndef DESKTOP_VERSION 41#ifndef DESKTOP_VERSION
42 if ( QApplication::desktop()->width() > 320 ) 42 if ( QApplication::desktop()->width() > 320 )
43 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); 43 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/");
44 else 44 else
45 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); 45 KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/");
46#else 46#else
47 QString fileName ; 47 QString fileName ;
48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/"; 48 fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/";
49 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); 49 KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName));
50 50
51#endif 51#endif
52 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); 52 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook")));
53 KAddressBookMain* m = new KAddressBookMain(); 53 KAddressBookMain m ;
54//US MainWindow m; 54//US MainWindow m;
55//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 55//US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
56 56
57#ifndef DESKTOP_VERSION 57#ifndef DESKTOP_VERSION
58 a.showMainWidget(m ); 58 a.showMainWidget( &m );
59 m->showMaximized();
60#else 59#else
61 a.setMainWidget(m ); 60 a.setMainWidget(m );
62 m->show(); 61 m->show();
63 //m->resize( 640, 480 );
64#endif 62#endif
65 a.exec(); 63 a.exec();
66 64
67 } 65 }
68 qDebug("KA: Bye! "); 66 qDebug("KA: Bye! ");
69} 67}
70 68
71/* 69/*
72#include <stdlib.h> 70#include <stdlib.h>
73 71
74#include <qstring.h> 72#include <qstring.h>
75 73
76#include <kabc/stdaddressbook.h> 74#include <kabc/stdaddressbook.h>
77#include <kaboutdata.h> 75#include <kaboutdata.h>
78#include <kcmdlineargs.h> 76#include <kcmdlineargs.h>
79#include <kcrash.h> 77#include <kcrash.h>
80#include <kdebug.h> 78#include <kdebug.h>
81#include <klocale.h> 79#include <klocale.h>
82#include <kstartupinfo.h> 80#include <kstartupinfo.h>
83#include <kuniqueapplication.h> 81#include <kuniqueapplication.h>
84#include <kwin.h> 82#include <kwin.h>
85 83
86#include "kaddressbookmain.h" 84#include "kaddressbookmain.h"
87#include "kabcore.h" 85#include "kabcore.h"
88 86
89extern "C" { 87extern "C" {
90 88
91void crashHandler( int ) 89void crashHandler( int )
92{ 90{
93 KABC::StdAddressBook::handleCrash(); 91 KABC::StdAddressBook::handleCrash();
94 ::exit( 0 ); 92 ::exit( 0 );
95} 93}
96 94
97} 95}
98 96
99class KAddressBookApp : public KUniqueApplication { 97class KAddressBookApp : public KUniqueApplication {
100 public: 98 public:
101 KAddressBookApp() : mMainWin( 0 ) {} 99 KAddressBookApp() : mMainWin( 0 ) {}
102 ~KAddressBookApp() {} 100 ~KAddressBookApp() {}
103 101
104 int newInstance(); 102 int newInstance();
105 103
106 private: 104 private:
107 KAddressBookMain *mMainWin; 105 KAddressBookMain *mMainWin;
108}; 106};
109 107
110int KAddressBookApp::newInstance() 108int KAddressBookApp::newInstance()
111{ 109{
112 if ( isRestored() ) { 110 if ( isRestored() ) {
113 // There can only be one main window 111 // There can only be one main window
114 if ( KMainWindow::canBeRestored( 1 ) ) { 112 if ( KMainWindow::canBeRestored( 1 ) ) {
115 mMainWin = new KAddressBookMain; 113 mMainWin = new KAddressBookMain;
116 mMainWin->show(); 114 mMainWin->show();
117 mMainWin->restore( 1 ); 115 mMainWin->restore( 1 );
118 } 116 }
119 } else { 117 } else {
120 KCmdLineArgs *args = KCmdLineArgs::parsedArgs(); 118 KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
121 119
122 QCString addrStr = args->getOption( "addr" ); 120 QCString addrStr = args->getOption( "addr" );
123 QCString uidStr = args->getOption( "uid" ); 121 QCString uidStr = args->getOption( "uid" );
124 QString addr; 122 QString addr;
125 QString uid; 123 QString uid;
126 if ( !addrStr.isEmpty() ) 124 if ( !addrStr.isEmpty() )
127 addr = QString::fromLocal8Bit( addrStr ); 125 addr = QString::fromLocal8Bit( addrStr );