-rw-r--r-- | kabc/stdaddressbook.cpp | 27 | ||||
-rw-r--r-- | kabc/stdaddressbook.h | 2 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 |
3 files changed, 27 insertions, 4 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index a14ae20..43d9fde 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp @@ -58,2 +58,19 @@ void StdAddressBook::handleCrash() } +StdAddressBook *StdAddressBook::selfNoLoad() +{ + + if ( !mSelf ) + { + QString appdir = StdAddressBook::setTempAppDir(); +// US im am not sure why I have to use the other format here?? +#ifdef KAB_EMBEDDED + mSelf = addressBookDeleter.setObject( new StdAddressBook ( QString() ) ); +#else //KAB_EMBEDDED + addressBookDeleter.setObject( mSelf, new StdAddressBook( QString() ) ); +#endif //KAB_EMBEDDED + KStandardDirs::setAppDir( appdir ); + } + + return mSelf; +} @@ -110,2 +127,7 @@ StdAddressBook *StdAddressBook::self( bool onlyFastResources ) } +StdAddressBook::StdAddressBook( QString ) + : AddressBook( "kabcrc" ) +{ + +} @@ -115,3 +137,3 @@ StdAddressBook::StdAddressBook() - //init( false ); + init( false ); } @@ -122,4 +144,3 @@ StdAddressBook::StdAddressBook( bool onlyFastResources ) - if ( onlyFastResources ) - init( onlyFastResources ); + init( onlyFastResources ); } diff --git a/kabc/stdaddressbook.h b/kabc/stdaddressbook.h index cf130b3..3cd6363 100644 --- a/kabc/stdaddressbook.h +++ b/kabc/stdaddressbook.h @@ -72,2 +72,3 @@ class StdAddressBook : public AddressBook static StdAddressBook *self(); + static StdAddressBook *selfNoLoad(); @@ -140,2 +141,3 @@ class StdAddressBook : public AddressBook StdAddressBook(); + StdAddressBook( QString ); StdAddressBook( bool onlyFastResources ); diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c670b1f..77321aa 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -305,3 +305,3 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mIsPart = !parent->inherits( "KAddressBookMain" ); - mAddressBook = KABC::StdAddressBook::self(); + mAddressBook = KABC::StdAddressBook::selfNoLoad(); KABC::StdAddressBook::setAutomaticSave( false ); |