summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kabc/stdaddressbook.cpp25
-rw-r--r--kabc/stdaddressbook.h2
-rw-r--r--kaddressbook/kabcore.cpp2
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
@@ -57,4 +57,21 @@ 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()
@@ -109,4 +126,9 @@ StdAddressBook *StdAddressBook::self( bool onlyFastResources )
return mSelf;
}
+StdAddressBook::StdAddressBook( QString )
+ : AddressBook( "kabcrc" )
+{
+
+}
StdAddressBook::StdAddressBook()
@@ -114,5 +136,5 @@ StdAddressBook::StdAddressBook()
{
- //init( false );
+ init( false );
}
@@ -121,5 +143,4 @@ StdAddressBook::StdAddressBook( bool onlyFastResources )
{
- if ( 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
@@ -71,4 +71,5 @@ class StdAddressBook : public AddressBook
*/
static StdAddressBook *self();
+ static StdAddressBook *selfNoLoad();
/**
@@ -139,4 +140,5 @@ class StdAddressBook : public AddressBook
protected:
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
@@ -304,5 +304,5 @@ KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const
mExtensionBarSplitter = 0;
mIsPart = !parent->inherits( "KAddressBookMain" );
- mAddressBook = KABC::StdAddressBook::self();
+ mAddressBook = KABC::StdAddressBook::selfNoLoad();
KABC::StdAddressBook::setAutomaticSave( false );