-rw-r--r-- | kabc/stdaddressbook.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index f17f366..a14ae20 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp @@ -84,71 +84,72 @@ QString StdAddressBook::setTempAppDir() appdir += "kaddressbook/"; else appdir += "/kaddressbook/"; KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); #else QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; KStandardDirs::setAppDir( appdir ); #endif return appDIR; } StdAddressBook *StdAddressBook::self( bool onlyFastResources ) { if ( !mSelf ) { QString appdir =StdAddressBook::setTempAppDir(); #ifdef KAB_EMBEDDED mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); #else //KAB_EMBEDDED addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); #endif //KAB_EMBEDDED KStandardDirs::setAppDir( appdir ); } return mSelf; } StdAddressBook::StdAddressBook() : AddressBook( "kabcrc" ) { - init( false ); + //init( false ); } StdAddressBook::StdAddressBook( bool onlyFastResources ) : AddressBook( "kabcrc" ) { + if ( onlyFastResources ) init( onlyFastResources ); } StdAddressBook::~StdAddressBook() { if ( mAutomaticSave ) save(); } void StdAddressBook::init( bool ) { KRES::Manager<Resource> *manager = resourceManager(); KRES::Manager<Resource>::ActiveIterator it; for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { (*it)->setAddressBook( this ); if ( !(*it)->open() ) error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); } Resource *res = standardResource(); if ( !res ) { res = manager->createResource( "file" ); if ( res ) { addResource( res ); } else qDebug(" No resource available!!!"); } setStandardResource( res ); |