-rw-r--r-- | kabc/stdaddressbook.cpp | 17 | ||||
-rw-r--r-- | kaddressbook/mainembedded.cpp | 4 | ||||
-rw-r--r-- | korganizer/main.cpp | 4 |
3 files changed, 9 insertions, 16 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index 144a9dc..075f12f 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp | |||
@@ -4,62 +4,49 @@ | |||
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | 24 | ||
25 | $Id$ | 25 | $Id$ |
26 | */ | 26 | */ |
27 | 27 | ||
28 | /*US | ||
29 | #include <stdlib.h> | ||
30 | |||
31 | #include <kapplication.h> | ||
32 | #include <kcrash.h> | ||
33 | #include <ksimpleconfig.h> | ||
34 | */ | ||
35 | |||
36 | #ifndef DESKTOP_VERSION | ||
37 | #include <qpe/global.h> | ||
38 | #else | ||
39 | #include <qdir.h> | 28 | #include <qdir.h> |
40 | #endif | ||
41 | |||
42 | #include "resource.h" | 29 | #include "resource.h" |
43 | #include <kresources/manager.h> | 30 | #include <kresources/manager.h> |
44 | #include <kdebug.h> | 31 | #include <kdebug.h> |
45 | #include <klocale.h> | 32 | #include <klocale.h> |
46 | #include <kstaticdeleter.h> | 33 | #include <kstaticdeleter.h> |
47 | #include <kstandarddirs.h> | 34 | #include <kstandarddirs.h> |
48 | 35 | ||
49 | #include "stdaddressbook.h" | 36 | #include "stdaddressbook.h" |
50 | 37 | ||
51 | using namespace KABC; | 38 | using namespace KABC; |
52 | 39 | ||
53 | StdAddressBook *StdAddressBook::mSelf = 0; | 40 | StdAddressBook *StdAddressBook::mSelf = 0; |
54 | bool StdAddressBook::mAutomaticSave = true; | 41 | bool StdAddressBook::mAutomaticSave = true; |
55 | 42 | ||
56 | static KStaticDeleter<StdAddressBook> addressBookDeleter; | 43 | static KStaticDeleter<StdAddressBook> addressBookDeleter; |
57 | 44 | ||
58 | QString StdAddressBook::fileName() | 45 | QString StdAddressBook::fileName() |
59 | { | 46 | { |
60 | return locateLocal( "data", "kabc/std.vcf" ); | 47 | return locateLocal( "data", "kabc/std.vcf" ); |
61 | } | 48 | } |
62 | 49 | ||
63 | QString StdAddressBook::directoryName() | 50 | QString StdAddressBook::directoryName() |
64 | { | 51 | { |
65 | return locateLocal( "data", "kabc/stdvcf" ); | 52 | return locateLocal( "data", "kabc/stdvcf" ); |
@@ -80,49 +67,51 @@ StdAddressBook *StdAddressBook::self() | |||
80 | kdDebug(5700) << "StdAddressBook::self()" << endl; | 67 | kdDebug(5700) << "StdAddressBook::self()" << endl; |
81 | // US im am not sure why I have to use the other format here?? | 68 | // US im am not sure why I have to use the other format here?? |
82 | #ifdef KAB_EMBEDDED | 69 | #ifdef KAB_EMBEDDED |
83 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); | 70 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); |
84 | #else //KAB_EMBEDDED | 71 | #else //KAB_EMBEDDED |
85 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); | 72 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); |
86 | #endif //KAB_EMBEDDED | 73 | #endif //KAB_EMBEDDED |
87 | KStandardDirs::setAppDir( appdir ); | 74 | KStandardDirs::setAppDir( appdir ); |
88 | } | 75 | } |
89 | 76 | ||
90 | return mSelf; | 77 | return mSelf; |
91 | } | 78 | } |
92 | 79 | ||
93 | QString StdAddressBook::setTempAppDir() | 80 | QString StdAddressBook::setTempAppDir() |
94 | { | 81 | { |
95 | QString appDIR = KStandardDirs::appDir(); | 82 | QString appDIR = KStandardDirs::appDir(); |
96 | #ifdef DESKTOP_VERSION | 83 | #ifdef DESKTOP_VERSION |
97 | QString appdir = QDir::homeDirPath(); | 84 | QString appdir = QDir::homeDirPath(); |
98 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 85 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
99 | appdir += "kaddressbook/"; | 86 | appdir += "kaddressbook/"; |
100 | else | 87 | else |
101 | appdir += "/kaddressbook/"; | 88 | appdir += "/kaddressbook/"; |
102 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 89 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
103 | #else | 90 | #else |
104 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); | 91 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; |
92 | |||
93 | KStandardDirs::setAppDir( appdir ); | ||
105 | #endif | 94 | #endif |
106 | 95 | ||
107 | return appDIR; | 96 | return appDIR; |
108 | } | 97 | } |
109 | StdAddressBook *StdAddressBook::self( bool onlyFastResources ) | 98 | StdAddressBook *StdAddressBook::self( bool onlyFastResources ) |
110 | { | 99 | { |
111 | 100 | ||
112 | if ( !mSelf ) | 101 | if ( !mSelf ) |
113 | { | 102 | { |
114 | QString appdir =StdAddressBook::setTempAppDir(); | 103 | QString appdir =StdAddressBook::setTempAppDir(); |
115 | #ifdef KAB_EMBEDDED | 104 | #ifdef KAB_EMBEDDED |
116 | mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); | 105 | mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); |
117 | #else //KAB_EMBEDDED | 106 | #else //KAB_EMBEDDED |
118 | addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); | 107 | addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); |
119 | #endif //KAB_EMBEDDED | 108 | #endif //KAB_EMBEDDED |
120 | KStandardDirs::setAppDir( appdir ); | 109 | KStandardDirs::setAppDir( appdir ); |
121 | } | 110 | } |
122 | return mSelf; | 111 | return mSelf; |
123 | } | 112 | } |
124 | 113 | ||
125 | StdAddressBook::StdAddressBook() | 114 | StdAddressBook::StdAddressBook() |
126 | //US : AddressBook( "kabcrc" ) | 115 | //US : AddressBook( "kabcrc" ) |
127 | : AddressBook( locateLocal( "config", "kabcrc") ) | 116 | : AddressBook( locateLocal( "config", "kabcrc") ) |
128 | { | 117 | { |
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 3f6f69d..47b5484 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp | |||
@@ -19,49 +19,51 @@ int main( int argc, char **argv ) | |||
19 | { | 19 | { |
20 | #ifndef DESKTOP_VERSION | 20 | #ifndef DESKTOP_VERSION |
21 | QPEApplication a( argc, argv ); | 21 | QPEApplication a( argc, argv ); |
22 | a.setKeepRunning (); | 22 | a.setKeepRunning (); |
23 | #else | 23 | #else |
24 | QApplication a( argc, argv ); | 24 | QApplication a( argc, argv ); |
25 | QApplication::setStyle( new QPlatinumStyle ()); | 25 | QApplication::setStyle( new QPlatinumStyle ()); |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | bool exitHelp = false; | 28 | bool exitHelp = false; |
29 | if ( argc > 1 ) { | 29 | if ( argc > 1 ) { |
30 | QString command = argv[1]; | 30 | QString command = argv[1]; |
31 | if ( command == "-help" ){ | 31 | if ( command == "-help" ){ |
32 | printf("KA/E command line commands:\n"); | 32 | printf("KA/E command line commands:\n"); |
33 | printf(" no command: Start KA/E in usual way\n"); | 33 | printf(" no command: Start KA/E in usual way\n"); |
34 | printf(" -help: This output\n"); | 34 | printf(" -help: This output\n"); |
35 | printf(" KA/E is exiting now. Bye!\n"); | 35 | printf(" KA/E is exiting now. Bye!\n"); |
36 | exitHelp = true; | 36 | exitHelp = true; |
37 | } | 37 | } |
38 | } | 38 | } |
39 | if ( ! exitHelp ) { | 39 | if ( ! exitHelp ) { |
40 | 40 | ||
41 | KGlobal::setAppName( "kaddressbook" ); | 41 | KGlobal::setAppName( "kaddressbook" ); |
42 | #ifndef DESKTOP_VERSION | 42 | #ifndef DESKTOP_VERSION |
43 | KStandardDirs::setAppDir( Global::applicationFileName( "kaddressbook", "" ) ); | 43 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName(); |
44 | |||
45 | KStandardDirs::setAppDir( appdir ); | ||
44 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); | 46 | KGlobal::iconLoader()->setIconPath(QString(getenv("QPEDIR"))+"/pics/kdepim/kaddressbook/icons16/"); |
45 | #else | 47 | #else |
46 | QString fileName ; | 48 | QString fileName ; |
47 | #ifndef _WIN32_ | 49 | #ifndef _WIN32_ |
48 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; | 50 | fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons16/"; |
49 | #else | 51 | #else |
50 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; | 52 | fileName = qApp->applicationDirPath () + "\\kdepim\\kaddressbook\\icons16\\"; |
51 | #endif | 53 | #endif |
52 | KGlobal::iconLoader()->setIconPath(fileName); | 54 | KGlobal::iconLoader()->setIconPath(fileName); |
53 | QString appdir = QDir::homeDirPath(); | 55 | QString appdir = QDir::homeDirPath(); |
54 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 56 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
55 | appdir += "kaddressbook"; | 57 | appdir += "kaddressbook"; |
56 | else | 58 | else |
57 | appdir += "/kaddressbook"; | 59 | appdir += "/kaddressbook"; |
58 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 60 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
59 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | 61 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); |
60 | #endif // desktop | 62 | #endif // desktop |
61 | QDir app_dir; | 63 | QDir app_dir; |
62 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | 64 | if ( !app_dir.exists(KStandardDirs::appDir()) ) |
63 | app_dir.mkdir (KStandardDirs::appDir()); | 65 | app_dir.mkdir (KStandardDirs::appDir()); |
64 | 66 | ||
65 | KAddressBookMain* m = new KAddressBookMain(); | 67 | KAddressBookMain* m = new KAddressBookMain(); |
66 | //US MainWindow m; | 68 | //US MainWindow m; |
67 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); | 69 | //US QObject::connect( &a, SIGNAL (appMessage ( const QCString &, const QByteArray & )),&m, SLOT(recieve( const QCString&, const QByteArray& ))); |
diff --git a/korganizer/main.cpp b/korganizer/main.cpp index 6843595..a357988 100644 --- a/korganizer/main.cpp +++ b/korganizer/main.cpp | |||
@@ -36,49 +36,51 @@ int main( int argc, char **argv ) | |||
36 | printf(" -help: This output\n"); | 36 | printf(" -help: This output\n"); |
37 | printf("Next Option: Open or Show after start:\n"); | 37 | printf("Next Option: Open or Show after start:\n"); |
38 | printf(" -newTodo: New Todo dialog\n"); | 38 | printf(" -newTodo: New Todo dialog\n"); |
39 | printf(" -newEvent: New Event dialog\n"); | 39 | printf(" -newEvent: New Event dialog\n"); |
40 | printf(" -showList: List view\n"); | 40 | printf(" -showList: List view\n"); |
41 | printf(" -showDay: Day view\n"); | 41 | printf(" -showDay: Day view\n"); |
42 | printf(" -showWWeek: Work Week view\n"); | 42 | printf(" -showWWeek: Work Week view\n"); |
43 | printf(" -showWeek: Week view\n"); | 43 | printf(" -showWeek: Week view\n"); |
44 | printf(" -showTodo: Todo view\n"); | 44 | printf(" -showTodo: Todo view\n"); |
45 | printf(" -showJournal: Journal view\n"); | 45 | printf(" -showJournal: Journal view\n"); |
46 | printf(" -showKO: Next Days view\n"); | 46 | printf(" -showKO: Next Days view\n"); |
47 | printf(" -showWNext: What's Next view\n"); | 47 | printf(" -showWNext: What's Next view\n"); |
48 | printf(" -showNextXView: Next X View\n"); | 48 | printf(" -showNextXView: Next X View\n"); |
49 | printf(" -new[Y] and -show[X] may be used togehther\n"); | 49 | printf(" -new[Y] and -show[X] may be used togehther\n"); |
50 | printf(" KO/Pi is exiting now. Bye!\n"); | 50 | printf(" KO/Pi is exiting now. Bye!\n"); |
51 | exitHelp = true; | 51 | exitHelp = true; |
52 | } | 52 | } |
53 | } | 53 | } |
54 | if ( ! exitHelp ) { | 54 | if ( ! exitHelp ) { |
55 | KGlobal::setAppName( "korganizer" ); | 55 | KGlobal::setAppName( "korganizer" ); |
56 | 56 | ||
57 | 57 | ||
58 | QString fileName ; | 58 | QString fileName ; |
59 | #ifndef DESKTOP_VERSION | 59 | #ifndef DESKTOP_VERSION |
60 | KStandardDirs::setAppDir( Global::applicationFileName( "korganizer", "" ) ); | 60 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/" + KGlobal::getAppName(); |
61 | KStandardDirs::setAppDir( appdir ); | ||
62 | |||
61 | fileName = getenv("QPEDIR"); | 63 | fileName = getenv("QPEDIR"); |
62 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); | 64 | KGlobal::iconLoader()->setIconPath( fileName +"/pics/kdepim/korganizer/"); |
63 | #else | 65 | #else |
64 | 66 | ||
65 | #ifndef _WIN32_ | 67 | #ifndef _WIN32_ |
66 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; | 68 | fileName = qApp->applicationDirPath () + "/kdepim/korganizer/"; |
67 | #else | 69 | #else |
68 | fileName = qApp->applicationDirPath () + "\\kdepim\\korganizer\\"; | 70 | fileName = qApp->applicationDirPath () + "\\kdepim\\korganizer\\"; |
69 | #endif | 71 | #endif |
70 | 72 | ||
71 | KGlobal::iconLoader()->setIconPath(fileName); | 73 | KGlobal::iconLoader()->setIconPath(fileName); |
72 | 74 | ||
73 | QString appdir = QDir::homeDirPath(); | 75 | QString appdir = QDir::homeDirPath(); |
74 | //appdir = "C:\\"; | 76 | //appdir = "C:\\"; |
75 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) | 77 | if ( appdir.right(1) == "\\" || appdir.right(1) == "/" ) |
76 | appdir += "korganizer"; | 78 | appdir += "korganizer"; |
77 | else | 79 | else |
78 | appdir += "/korganizer"; | 80 | appdir += "/korganizer"; |
79 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 81 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
80 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); | 82 | // qDebug(" %s ",KStandardDirs::appDir().latin1() ); |
81 | #endif | 83 | #endif |
82 | QDir app_dir; | 84 | QDir app_dir; |
83 | if ( !app_dir.exists(KStandardDirs::appDir()) ) | 85 | if ( !app_dir.exists(KStandardDirs::appDir()) ) |
84 | app_dir.mkdir (KStandardDirs::appDir()); | 86 | app_dir.mkdir (KStandardDirs::appDir()); |