author | zautrix <zautrix> | 2005-08-23 14:22:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-08-23 14:22:11 (UTC) |
commit | e6d678229580cd712ff82ea989e7b151be546dbd (patch) (side-by-side diff) | |
tree | 1cf32674db62993bcdc636d90b3994e9343a8b5f | |
parent | 02fa432f183ad2b18380de0e41399efe3b867dba (diff) | |
download | kdepimpi-e6d678229580cd712ff82ea989e7b151be546dbd.zip kdepimpi-e6d678229580cd712ff82ea989e7b151be546dbd.tar.gz kdepimpi-e6d678229580cd712ff82ea989e7b151be546dbd.tar.bz2 |
stdab fix
-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 @@ -55,8 +55,25 @@ QString StdAddressBook::directoryName() void StdAddressBook::handleCrash() { StdAddressBook::self()->cleanUp(); } +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; +} StdAddressBook *StdAddressBook::self() { @@ -107,22 +124,26 @@ StdAddressBook *StdAddressBook::self( bool onlyFastResources ) KStandardDirs::setAppDir( appdir ); } return mSelf; } +StdAddressBook::StdAddressBook( QString ) + : AddressBook( "kabcrc" ) +{ + +} StdAddressBook::StdAddressBook() : AddressBook( "kabcrc" ) { - //init( false ); + init( false ); } StdAddressBook::StdAddressBook( bool onlyFastResources ) : AddressBook( "kabcrc" ) { - if ( onlyFastResources ) - init( onlyFastResources ); + init( onlyFastResources ); } StdAddressBook::~StdAddressBook() { 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 Return the standard addressbook object. It also loads slow resources. It is the same as self(false); . */ static StdAddressBook *self(); + static StdAddressBook *selfNoLoad(); /** This is the same as above, but with specified behaviour of resource loading. @@ -137,8 +138,9 @@ class StdAddressBook : public AddressBook void init( bool onlyFastResources ); protected: StdAddressBook(); + StdAddressBook( QString ); StdAddressBook( bool onlyFastResources ); private: diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index c670b1f..77321aa 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -302,9 +302,9 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const mIncSearchWidget = 0; mMiniSplitter = 0; mExtensionBarSplitter = 0; mIsPart = !parent->inherits( "KAddressBookMain" ); - mAddressBook = KABC::StdAddressBook::self(); + mAddressBook = KABC::StdAddressBook::selfNoLoad(); KABC::StdAddressBook::setAutomaticSave( false ); #ifndef KAB_EMBEDDED mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); |