summaryrefslogtreecommitdiffabout
path: root/korganizer/main.cpp
Unidiff
Diffstat (limited to 'korganizer/main.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/main.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/main.cpp b/korganizer/main.cpp
index 4194d12..2481ca4 100644
--- a/korganizer/main.cpp
+++ b/korganizer/main.cpp
@@ -1,45 +1,46 @@
1 1
2 2
3#ifndef DESKTOP_VERSION 3#ifndef DESKTOP_VERSION
4#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
5#include <qcopchannel_qws.h> 5#include <qcopchannel_qws.h>
6#include <qpe/global.h> 6#include <qpe/global.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#else 8#else
9#include <qapplication.h> 9#include <qapplication.h>
10#include <qstring.h> 10#include <qstring.h>
11#include <qwindowsstyle.h> 11#include <qwindowsstyle.h>
12#include <qplatinumstyle.h> 12#include <qplatinumstyle.h>
13#include <qsgistyle.h> 13#include <qsgistyle.h>
14#endif 14#endif
15#include <qtextcodec.h> 15#include <qtextcodec.h>
16 16
17#include <qdir.h> 17#include <qdir.h>
18#include <kstandarddirs.h> 18#include <kstandarddirs.h>
19#include <kglobal.h> 19#include <kglobal.h>
20#include <stdio.h> 20#include <stdio.h>
21#include "mainwindow.h" 21#include "mainwindow.h"
22#include <libkdepim/kpimglobalprefs.h>
22void dumpMissing(); 23void dumpMissing();
23int main( int argc, char **argv ) 24int main( int argc, char **argv )
24{ 25{
25#ifndef DESKTOP_VERSION 26#ifndef DESKTOP_VERSION
26 QPEApplication a( argc, argv ); 27 QPEApplication a( argc, argv );
27 a.setKeepRunning (); 28 a.setKeepRunning ();
28#else 29#else
29 QApplication a( argc, argv ); 30 QApplication a( argc, argv );
30 QApplication::setStyle( new QPlatinumStyle ()); 31 QApplication::setStyle( new QPlatinumStyle ());
31 QString hdir = QDir::homeDirPath(); 32 QString hdir = QDir::homeDirPath();
32 // there is a bug when creating dirs for WIN 98 33 // there is a bug when creating dirs for WIN 98
33 // it is difficult to fix, because we have no WIN 98 runnung 34 // it is difficult to fix, because we have no WIN 98 runnung
34 // such that we try it to create the dirs at startup here 35 // such that we try it to create the dirs at startup here
35 if ( hdir == "C:\\" ) { // win 98 or ME 36 if ( hdir == "C:\\" ) { // win 98 or ME
36 QDir app_dir; 37 QDir app_dir;
37 if ( !app_dir.exists("C:\\kdepim") ) 38 if ( !app_dir.exists("C:\\kdepim") )
38 app_dir.mkdir ("C:\\kdepim"); 39 app_dir.mkdir ("C:\\kdepim");
39 if ( !app_dir.exists("C:\\kdepim\\apps") ) 40 if ( !app_dir.exists("C:\\kdepim\\apps") )
40 app_dir.mkdir ("C:\\kdepim\\apps"); 41 app_dir.mkdir ("C:\\kdepim\\apps");
41 if ( !app_dir.exists("C:\\kdepim\\config") ) 42 if ( !app_dir.exists("C:\\kdepim\\config") )
42 app_dir.mkdir ("C:\\kdepim\\config"); 43 app_dir.mkdir ("C:\\kdepim\\config");
43 if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") ) 44 if ( !app_dir.exists("C:\\kdepim\\apps\\korganizer") )
44 app_dir.mkdir ("C:\\kdepim\\apps\\korganizer"); 45 app_dir.mkdir ("C:\\kdepim\\apps\\korganizer");
45 } 46 }
@@ -80,27 +81,29 @@ int main( int argc, char **argv )
80#endif 81#endif
81 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer"))); 82 KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "korganizer")));
82 MainWindow m; 83 MainWindow m;
83#ifndef DESKTOP_VERSION 84#ifndef DESKTOP_VERSION
84 85
85 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); 86 QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& )));
86 a.showMainWidget(&m ); 87 a.showMainWidget(&m );
87#else 88#else
88 a.setMainWidget(&m ); 89 a.setMainWidget(&m );
89 m.show(); 90 m.show();
90 //m.resize( 800, 600 ); 91 //m.resize( 800, 600 );
91 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); 92 QObject::connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
92#endif 93#endif
93 if ( argc > 1 ) { 94 if ( argc > 1 ) {
94 QCString command = argv[1]; 95 QCString command = argv[1];
95 if ( argc > 2 ) 96 if ( argc > 2 )
96 command += argv[2]; 97 command += argv[2];
97 qApp->processEvents(); 98 qApp->processEvents();
98 m.recieve(command, QByteArray() ); 99 m.recieve(command, QByteArray() );
99 100
100 } 101 }
101 102
102 a.exec(); 103 a.exec();
103 dumpMissing(); 104 dumpMissing();
105
106 KPimGlobalPrefs::instance()->writeConfig();
104 } 107 }
105 qDebug("KO: Bye! "); 108 qDebug("KO: Bye! ");
106} 109}