-rw-r--r-- | kabc/stdaddressbook.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp index 1e00cc6..760820e 100644 --- a/kabc/stdaddressbook.cpp +++ b/kabc/stdaddressbook.cpp | |||
@@ -59,9 +59,9 @@ void StdAddressBook::handleCrash() | |||
59 | 59 | ||
60 | StdAddressBook *StdAddressBook::self() | 60 | StdAddressBook *StdAddressBook::self() |
61 | { | 61 | { |
62 | 62 | ||
63 | if ( !mSelf ) | 63 | if ( !mSelf ) |
64 | { | 64 | { |
65 | QString appdir = StdAddressBook::setTempAppDir(); | 65 | QString appdir = StdAddressBook::setTempAppDir(); |
66 | 66 | ||
67 | kdDebug(5700) << "StdAddressBook::self()" << endl; | 67 | kdDebug(5700) << "StdAddressBook::self()" << endl; |
@@ -70,8 +70,8 @@ StdAddressBook *StdAddressBook::self() | |||
70 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); | 70 | mSelf = addressBookDeleter.setObject( new StdAddressBook ); |
71 | #else //KAB_EMBEDDED | 71 | #else //KAB_EMBEDDED |
72 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); | 72 | addressBookDeleter.setObject( mSelf, new StdAddressBook ); |
73 | #endif //KAB_EMBEDDED | 73 | #endif //KAB_EMBEDDED |
74 | KStandardDirs::setAppDir( appdir ); | 74 | KStandardDirs::setAppDir( appdir ); |
75 | } | 75 | } |
76 | 76 | ||
77 | return mSelf; | 77 | return mSelf; |
@@ -89,41 +89,39 @@ QString StdAddressBook::setTempAppDir() | |||
89 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); | 89 | KStandardDirs::setAppDir( QDir::convertSeparators( appdir )); |
90 | #else | 90 | #else |
91 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; | 91 | QString appdir = QDir::homeDirPath() + "/kdepim/apps/kaddressbook"; |
92 | 92 | ||
93 | KStandardDirs::setAppDir( appdir ); | 93 | KStandardDirs::setAppDir( appdir ); |
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | return appDIR; | 96 | return appDIR; |
97 | } | 97 | } |
98 | StdAddressBook *StdAddressBook::self( bool onlyFastResources ) | 98 | StdAddressBook *StdAddressBook::self( bool onlyFastResources ) |
99 | { | 99 | { |
100 | 100 | ||
101 | if ( !mSelf ) | 101 | if ( !mSelf ) |
102 | { | 102 | { |
103 | QString appdir =StdAddressBook::setTempAppDir(); | 103 | QString appdir =StdAddressBook::setTempAppDir(); |
104 | #ifdef KAB_EMBEDDED | 104 | #ifdef KAB_EMBEDDED |
105 | mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); | 105 | mSelf = addressBookDeleter.setObject( new StdAddressBook( onlyFastResources ) ); |
106 | #else //KAB_EMBEDDED | 106 | #else //KAB_EMBEDDED |
107 | addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); | 107 | addressBookDeleter.setObject( mSelf, new StdAddressBook( onlyFastResources ) ); |
108 | #endif //KAB_EMBEDDED | 108 | #endif //KAB_EMBEDDED |
109 | KStandardDirs::setAppDir( appdir ); | 109 | KStandardDirs::setAppDir( appdir ); |
110 | } | 110 | } |
111 | return mSelf; | 111 | return mSelf; |
112 | } | 112 | } |
113 | 113 | ||
114 | StdAddressBook::StdAddressBook() | 114 | StdAddressBook::StdAddressBook() |
115 | //US : AddressBook( "kabcrc" ) | 115 | : AddressBook( "kabcrc" ) |
116 | : AddressBook( locateLocal( "config", "kabcrc") ) | ||
117 | { | 116 | { |
118 | 117 | ||
119 | init( false ); | 118 | init( false ); |
120 | } | 119 | } |
121 | 120 | ||
122 | StdAddressBook::StdAddressBook( bool onlyFastResources ) | 121 | StdAddressBook::StdAddressBook( bool onlyFastResources ) |
123 | //US : AddressBook( "kabcrc" ) | 122 | : AddressBook( "kabcrc" ) |
124 | : AddressBook( locateLocal( "config", "kabcrc") ) | ||
125 | { | 123 | { |
126 | 124 | ||
127 | init( onlyFastResources ); | 125 | init( onlyFastResources ); |
128 | } | 126 | } |
129 | 127 | ||
@@ -143,7 +141,7 @@ void StdAddressBook::init( bool ) | |||
143 | if ( !(*it)->open() ) | 141 | if ( !(*it)->open() ) |
144 | error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); | 142 | error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); |
145 | } | 143 | } |
146 | 144 | ||
147 | Resource *res = standardResource(); | 145 | Resource *res = standardResource(); |
148 | if ( !res ) { | 146 | if ( !res ) { |
149 | res = manager->createResource( "file" ); | 147 | res = manager->createResource( "file" ); |
@@ -186,7 +184,7 @@ bool StdAddressBook::save() | |||
186 | ok = false; | 184 | ok = false; |
187 | } | 185 | } |
188 | } | 186 | } |
189 | 187 | ||
190 | return ok; | 188 | return ok; |
191 | } | 189 | } |
192 | 190 | ||
@@ -195,7 +193,7 @@ void StdAddressBook::close() | |||
195 | //US destructObject is not defined on my system???. Is setObject(0) the same ??? | 193 | //US destructObject is not defined on my system???. Is setObject(0) the same ??? |
196 | //US addressBookDeleter.destructObject(); | 194 | //US addressBookDeleter.destructObject(); |
197 | addressBookDeleter.setObject(0); | 195 | addressBookDeleter.setObject(0); |
198 | 196 | ||
199 | } | 197 | } |
200 | 198 | ||
201 | void StdAddressBook::setAutomaticSave( bool enable ) | 199 | void StdAddressBook::setAutomaticSave( bool enable ) |