-rw-r--r-- | kabc/stdaddressbook.cpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index f9fc70b..8faaaef 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp | |||
@@ -15,69 +15,56 @@ | |||
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 | #ifndef DESKTOP_VERSION | ||
28 | #include <qpe/global.h> | ||
29 | #else | ||
30 | |||
31 | #include <qdir.h> | ||
32 | #endif | ||
33 | #ifdef KAB_EMBEDDED | ||
34 | 27 | ||
28 | /*US | ||
35 | #include <stdlib.h> | 29 | #include <stdlib.h> |
36 | #else //KAB_EMBEDDED | ||
37 | 30 | ||
38 | #include <stdlib.h> | ||
39 | |||
40 | //US#include <kresources/manager.h> | ||
41 | #include <kapplication.h> | 31 | #include <kapplication.h> |
42 | #include <kcrash.h> | 32 | #include <kcrash.h> |
43 | #include <ksimpleconfig.h> | 33 | #include <ksimpleconfig.h> |
44 | 34 | */ | |
45 | |||
46 | #endif //KAB_EMBEDDED | ||
47 | 35 | ||
48 | #include "resource.h" | 36 | #include "resource.h" |
49 | #include <kresources/manager.h> | 37 | #include <kresources/manager.h> |
50 | #include <kdebug.h> | 38 | #include <kdebug.h> |
51 | #include <klocale.h> | 39 | #include <klocale.h> |
52 | #include <kstaticdeleter.h> | 40 | #include <kstaticdeleter.h> |
53 | #include <kstandarddirs.h> | 41 | #include <kstandarddirs.h> |
54 | 42 | ||
55 | #include "stdaddressbook.h" | 43 | #include "stdaddressbook.h" |
56 | 44 | ||
57 | using namespace KABC; | 45 | using namespace KABC; |
58 | 46 | ||
59 | StdAddressBook *StdAddressBook::mSelf = 0; | 47 | StdAddressBook *StdAddressBook::mSelf = 0; |
60 | bool StdAddressBook::mAutomaticSave = true; | 48 | bool StdAddressBook::mAutomaticSave = true; |
61 | 49 | ||
62 | static KStaticDeleter<StdAddressBook> addressBookDeleter; | 50 | static KStaticDeleter<StdAddressBook> addressBookDeleter; |
63 | 51 | ||
64 | QString StdAddressBook::fileName() | 52 | QString StdAddressBook::fileName() |
65 | { | 53 | { |
66 | return locateLocal( "data", "kabc/std.vcf" ); | 54 | return locateLocal( "data", "kabc/std.vcf" ); |
67 | } | 55 | } |
68 | 56 | ||
69 | QString StdAddressBook::directoryName() | 57 | QString StdAddressBook::directoryName() |
70 | { | 58 | { |
71 | qDebug("StdAddressBook::directoryName() WILL FAIL OR NOT" ); | ||
72 | return locateLocal( "data", "kabc/stdvcf" ); | 59 | return locateLocal( "data", "kabc/stdvcf" ); |
73 | } | 60 | } |
74 | 61 | ||
75 | void StdAddressBook::handleCrash() | 62 | void StdAddressBook::handleCrash() |
76 | { | 63 | { |
77 | StdAddressBook::self()->cleanUp(); | 64 | StdAddressBook::self()->cleanUp(); |
78 | } | 65 | } |
79 | 66 | ||
80 | StdAddressBook *StdAddressBook::self() | 67 | StdAddressBook *StdAddressBook::self() |
81 | { | 68 | { |
82 | 69 | ||
83 | if ( !mSelf ) | 70 | if ( !mSelf ) |
@@ -202,29 +189,26 @@ bool StdAddressBook::save() | |||
202 | 189 | ||
203 | if ( !ab->save( ticket ) ) | 190 | if ( !ab->save( ticket ) ) |
204 | ok = false; | 191 | ok = false; |
205 | } | 192 | } |
206 | } | 193 | } |
207 | 194 | ||
208 | return ok; | 195 | return ok; |
209 | } | 196 | } |
210 | 197 | ||
211 | void StdAddressBook::close() | 198 | void StdAddressBook::close() |
212 | { | 199 | { |
213 | //US destructObject is not defined on my system???. Is setObject(0) the same ??? | 200 | //US destructObject is not defined on my system???. Is setObject(0) the same ??? |
214 | #ifndef KAB_EMBEDDED | 201 | //US addressBookDeleter.destructObject(); |
215 | addressBookDeleter.destructObject(); | ||
216 | #else //KAB_EMBEDDED | ||
217 | addressBookDeleter.setObject(0); | 202 | addressBookDeleter.setObject(0); |
218 | #endif //KAB_EMBEDDED | ||
219 | 203 | ||
220 | } | 204 | } |
221 | 205 | ||
222 | void StdAddressBook::setAutomaticSave( bool enable ) | 206 | void StdAddressBook::setAutomaticSave( bool enable ) |
223 | { | 207 | { |
224 | mAutomaticSave = enable; | 208 | mAutomaticSave = enable; |
225 | } | 209 | } |
226 | 210 | ||
227 | bool StdAddressBook::automaticSave() | 211 | bool StdAddressBook::automaticSave() |
228 | { | 212 | { |
229 | return mAutomaticSave; | 213 | return mAutomaticSave; |
230 | } | 214 | } |