-rw-r--r-- | kabc/stdaddressbook.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index 8faaaef..144a9dc 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp | |||
@@ -1,83 +1,89 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> |
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 | 28 | /*US |
29 | #include <stdlib.h> | 29 | #include <stdlib.h> |
30 | 30 | ||
31 | #include <kapplication.h> | 31 | #include <kapplication.h> |
32 | #include <kcrash.h> | 32 | #include <kcrash.h> |
33 | #include <ksimpleconfig.h> | 33 | #include <ksimpleconfig.h> |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #ifndef DESKTOP_VERSION | ||
37 | #include <qpe/global.h> | ||
38 | #else | ||
39 | #include <qdir.h> | ||
40 | #endif | ||
41 | |||
36 | #include "resource.h" | 42 | #include "resource.h" |
37 | #include <kresources/manager.h> | 43 | #include <kresources/manager.h> |
38 | #include <kdebug.h> | 44 | #include <kdebug.h> |
39 | #include <klocale.h> | 45 | #include <klocale.h> |
40 | #include <kstaticdeleter.h> | 46 | #include <kstaticdeleter.h> |
41 | #include <kstandarddirs.h> | 47 | #include <kstandarddirs.h> |
42 | 48 | ||
43 | #include "stdaddressbook.h" | 49 | #include "stdaddressbook.h" |
44 | 50 | ||
45 | using namespace KABC; | 51 | using namespace KABC; |
46 | 52 | ||
47 | StdAddressBook *StdAddressBook::mSelf = 0; | 53 | StdAddressBook *StdAddressBook::mSelf = 0; |
48 | bool StdAddressBook::mAutomaticSave = true; | 54 | bool StdAddressBook::mAutomaticSave = true; |
49 | 55 | ||
50 | static KStaticDeleter<StdAddressBook> addressBookDeleter; | 56 | static KStaticDeleter<StdAddressBook> addressBookDeleter; |
51 | 57 | ||
52 | QString StdAddressBook::fileName() | 58 | QString StdAddressBook::fileName() |
53 | { | 59 | { |
54 | return locateLocal( "data", "kabc/std.vcf" ); | 60 | return locateLocal( "data", "kabc/std.vcf" ); |
55 | } | 61 | } |
56 | 62 | ||
57 | QString StdAddressBook::directoryName() | 63 | QString StdAddressBook::directoryName() |
58 | { | 64 | { |
59 | return locateLocal( "data", "kabc/stdvcf" ); | 65 | return locateLocal( "data", "kabc/stdvcf" ); |
60 | } | 66 | } |
61 | 67 | ||
62 | void StdAddressBook::handleCrash() | 68 | void StdAddressBook::handleCrash() |
63 | { | 69 | { |
64 | StdAddressBook::self()->cleanUp(); | 70 | StdAddressBook::self()->cleanUp(); |
65 | } | 71 | } |
66 | 72 | ||
67 | StdAddressBook *StdAddressBook::self() | 73 | StdAddressBook *StdAddressBook::self() |
68 | { | 74 | { |
69 | 75 | ||
70 | if ( !mSelf ) | 76 | if ( !mSelf ) |
71 | { | 77 | { |
72 | QString appdir = StdAddressBook::setTempAppDir(); | 78 | QString appdir = StdAddressBook::setTempAppDir(); |
73 | 79 | ||
74 | kdDebug(5700) << "StdAddressBook::self()" << endl; | 80 | kdDebug(5700) << "StdAddressBook::self()" << endl; |
75 | // US im am not sure why I have to use the other format here?? | 81 | // US im am not sure why I have to use the other format here?? |
76 | #ifdef KAB_EMBEDDED | 82 | #ifdef KAB_EMBEDDED |
77 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); | 83 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); |
78 | #else //KAB_EMBEDDED | 84 | #else //KAB_EMBEDDED |
79 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); | 85 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); |
80 | #endif //KAB_EMBEDDED | 86 | #endif //KAB_EMBEDDED |
81 | KStandardDirs::setAppDir( appdir ); | 87 | KStandardDirs::setAppDir( appdir ); |
82 | } | 88 | } |
83 | 89 | ||