-rw-r--r-- | kabc/stdaddressbook.cpp | 27 | ||||
-rw-r--r-- | kabc/stdaddressbook.h | 2 |
2 files changed, 26 insertions, 3 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index a14ae20..43d9fde 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp | |||
@@ -55,8 +55,25 @@ QString StdAddressBook::directoryName() | |||
55 | void StdAddressBook::handleCrash() | 55 | void StdAddressBook::handleCrash() |
56 | { | 56 | { |
57 | StdAddressBook::self()->cleanUp(); | 57 | StdAddressBook::self()->cleanUp(); |
58 | } | 58 | } |
59 | StdAddressBook *StdAddressBook::selfNoLoad() | ||
60 | { | ||
61 | |||
62 | if ( !mSelf ) | ||
63 | { | ||
64 | QString appdir = StdAddressBook::setTempAppDir(); | ||
65 | // US im am not sure why I have to use the other format here?? | ||
66 | #ifdef KAB_EMBEDDED | ||
67 | mSelf = addressBookDeleter.setObject( new StdAddressBook ( QString() ) ); | ||
68 | #else //KAB_EMBEDDED | ||
69 | addressBookDeleter.setObject( mSelf, new StdAddressBook( QString() ) ); | ||
70 | #endif //KAB_EMBEDDED | ||
71 | KStandardDirs::setAppDir( appdir ); | ||
72 | } | ||
73 | |||
74 | return mSelf; | ||
75 | } | ||
59 | 76 | ||
60 | StdAddressBook *StdAddressBook::self() | 77 | StdAddressBook *StdAddressBook::self() |
61 | { | 78 | { |
62 | 79 | ||
@@ -107,22 +124,26 @@ StdAddressBook *StdAddressBook::self( bool onlyFastResources ) | |||
107 | KStandardDirs::setAppDir( appdir ); | 124 | KStandardDirs::setAppDir( appdir ); |
108 | } | 125 | } |
109 | return mSelf; | 126 | return mSelf; |
110 | } | 127 | } |
128 | StdAddressBook::StdAddressBook( QString ) | ||
129 | : AddressBook( "kabcrc" ) | ||
130 | { | ||
131 | |||
132 | } | ||
111 | 133 | ||
112 | StdAddressBook::StdAddressBook() | 134 | StdAddressBook::StdAddressBook() |
113 | : AddressBook( "kabcrc" ) | 135 | : AddressBook( "kabcrc" ) |
114 | { | 136 | { |
115 | 137 | ||
116 | //init( false ); | 138 | init( false ); |
117 | } | 139 | } |
118 | 140 | ||
119 | StdAddressBook::StdAddressBook( bool onlyFastResources ) | 141 | StdAddressBook::StdAddressBook( bool onlyFastResources ) |
120 | : AddressBook( "kabcrc" ) | 142 | : AddressBook( "kabcrc" ) |
121 | { | 143 | { |
122 | 144 | ||
123 | if ( onlyFastResources ) | 145 | init( onlyFastResources ); |
124 | init( onlyFastResources ); | ||
125 | } | 146 | } |
126 | 147 | ||
127 | StdAddressBook::~StdAddressBook() | 148 | StdAddressBook::~StdAddressBook() |
128 | { | 149 | { |
diff --git a/kabc/stdaddressbook.h b/kabc/stdaddressbook.h index cf130b3..3cd6363 100644 --- a/kabc/stdaddressbook.h +++ b/kabc/stdaddressbook.h | |||
@@ -69,8 +69,9 @@ class StdAddressBook : public AddressBook | |||
69 | Return the standard addressbook object. It also loads slow resources. | 69 | Return the standard addressbook object. It also loads slow resources. |
70 | It is the same as self(false); . | 70 | It is the same as self(false); . |
71 | */ | 71 | */ |
72 | static StdAddressBook *self(); | 72 | static StdAddressBook *self(); |
73 | static StdAddressBook *selfNoLoad(); | ||
73 | 74 | ||
74 | /** | 75 | /** |
75 | This is the same as above, but with specified | 76 | This is the same as above, but with specified |
76 | behaviour of resource loading. | 77 | behaviour of resource loading. |
@@ -137,8 +138,9 @@ class StdAddressBook : public AddressBook | |||
137 | void init( bool onlyFastResources ); | 138 | void init( bool onlyFastResources ); |
138 | 139 | ||
139 | protected: | 140 | protected: |
140 | StdAddressBook(); | 141 | StdAddressBook(); |
142 | StdAddressBook( QString ); | ||
141 | StdAddressBook( bool onlyFastResources ); | 143 | StdAddressBook( bool onlyFastResources ); |
142 | 144 | ||
143 | 145 | ||
144 | private: | 146 | private: |