-rw-r--r-- | kabc/stdaddressbook.cpp | 25 | ||||
-rw-r--r-- | kabc/stdaddressbook.h | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 |
3 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 | |||
@@ -56,6 +56,23 @@ 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 | { |
@@ -108,19 +125,23 @@ StdAddressBook *StdAddressBook::self( bool onlyFastResources ) | |||
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 ) | ||
124 | init( onlyFastResources ); | 145 | init( onlyFastResources ); |
125 | } | 146 | } |
126 | 147 | ||
diff --git a/kabc/stdaddressbook.h b/kabc/stdaddressbook.h index cf130b3..3cd6363 100644 --- a/kabc/stdaddressbook.h +++ b/kabc/stdaddressbook.h | |||
@@ -70,6 +70,7 @@ class StdAddressBook : public AddressBook | |||
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 |
@@ -138,6 +139,7 @@ class StdAddressBook : public AddressBook | |||
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 | ||
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c670b1f..77321aa 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -303,7 +303,7 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const | |||
303 | mMiniSplitter = 0; | 303 | mMiniSplitter = 0; |
304 | mExtensionBarSplitter = 0; | 304 | mExtensionBarSplitter = 0; |
305 | mIsPart = !parent->inherits( "KAddressBookMain" ); | 305 | mIsPart = !parent->inherits( "KAddressBookMain" ); |
306 | mAddressBook = KABC::StdAddressBook::self(); | 306 | mAddressBook = KABC::StdAddressBook::selfNoLoad(); |
307 | KABC::StdAddressBook::setAutomaticSave( false ); | 307 | KABC::StdAddressBook::setAutomaticSave( false ); |
308 | 308 | ||
309 | #ifndef KAB_EMBEDDED | 309 | #ifndef KAB_EMBEDDED |