Diffstat (limited to 'kaddressbook/mainembedded.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/mainembedded.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 10b1013..965fb06 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -2,32 +2,33 @@ | |||
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 <qregexp.h> | 12 | #include <qregexp.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 | #include "externalapphandler.h" | 17 | #include "externalapphandler.h" |
18 | #include <libkdepim/kpimglobalprefs.h> | ||
18 | 19 | ||
19 | int main( int argc, char **argv ) | 20 | int main( int argc, char **argv ) |
20 | { | 21 | { |
21 | #ifndef DESKTOP_VERSION | 22 | #ifndef DESKTOP_VERSION |
22 | QPEApplication a( argc, argv ); | 23 | QPEApplication a( argc, argv ); |
23 | a.setKeepRunning (); | 24 | a.setKeepRunning (); |
24 | #else | 25 | #else |
25 | QApplication a( argc, argv ); | 26 | QApplication a( argc, argv ); |
26 | QApplication::setStyle( new QPlatinumStyle ()); | 27 | QApplication::setStyle( new QPlatinumStyle ()); |
27 | QString hdir = QDir::homeDirPath(); | 28 | QString hdir = QDir::homeDirPath(); |
28 | // there is a bug when creating dirs for WIN 98 | 29 | // there is a bug when creating dirs for WIN 98 |
29 | // it is difficult to fix, because we have no WIN 98 runnung | 30 | // it is difficult to fix, because we have no WIN 98 runnung |
30 | // such that we try it to create the dirs at startup here | 31 | // such that we try it to create the dirs at startup here |
31 | if ( hdir == "C:\\" ) { // win 98 or ME | 32 | if ( hdir == "C:\\" ) { // win 98 or ME |
32 | QDir app_dir; | 33 | QDir app_dir; |
33 | if ( !app_dir.exists("C:\\kdepim") ) | 34 | if ( !app_dir.exists("C:\\kdepim") ) |
@@ -60,45 +61,33 @@ int main( int argc, char **argv ) | |||
60 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); | 61 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons22/"); |
61 | else | 62 | else |
62 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 63 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
63 | #else | 64 | #else |
64 | QString fileName ; | 65 | QString fileName ; |
65 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; | 66 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; |
66 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); | 67 | KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); |
67 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); | 68 | QApplication::addLibraryPath ( qApp->applicationDirPath () ); |
68 | 69 | ||
69 | #endif | 70 | #endif |
70 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); | 71 | KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); |
71 | KAddressBookMain m ; | 72 | KAddressBookMain m ; |
72 | //US MainWindow m; | 73 | //US MainWindow m; |
73 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); | 74 | QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); |
74 | 75 | ||
75 | { | 76 | { |
76 | KConfig kon ( locateLocal( "config", "korganizerrc" ) ); | 77 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
77 | kon.setGroup("Locale"); | ||
78 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); | ||
79 | QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); | ||
80 | KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) ); | ||
81 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | ||
82 | dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); | ||
83 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | ||
84 | kon.setGroup("Time & Date"); | ||
85 | KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), | ||
86 | kon.readNumEntry( "DaylightsavingStart", 90), | ||
87 | kon.readNumEntry( "DaylightsavingEnd",304) ); | ||
88 | KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); | ||
89 | } | 78 | } |
90 | #ifndef DESKTOP_VERSION | 79 | #ifndef DESKTOP_VERSION |
91 | a.showMainWidget( &m ); | 80 | a.showMainWidget( &m ); |
92 | #else | 81 | #else |
93 | a.setMainWidget( &m ); | 82 | a.setMainWidget( &m ); |
94 | m.resize (640, 480 ); | 83 | m.resize (640, 480 ); |
95 | m.show(); | 84 | m.show(); |
96 | #endif | 85 | #endif |
97 | a.exec(); | 86 | a.exec(); |
98 | 87 | ||
99 | } | 88 | } |
100 | qDebug("KA: Bye! "); | 89 | qDebug("KA: Bye! "); |
101 | } | 90 | } |
102 | 91 | ||
103 | /* | 92 | /* |
104 | #include <stdlib.h> | 93 | #include <stdlib.h> |