-rw-r--r-- | kabc/addressbook.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kabc/addressbook.cpp b/kabc/addressbook.cpp index 592d78d..c584c35 100644 --- a/kabc/addressbook.cpp +++ b/kabc/addressbook.cpp | |||
@@ -248,65 +248,65 @@ void AddressBook::init(const QString &config, const QString &family ) | |||
248 | if ( family == "syncContact" ) { | 248 | if ( family == "syncContact" ) { |
249 | qDebug("creating sync config "); | 249 | qDebug("creating sync config "); |
250 | fami = "contact"; | 250 | fami = "contact"; |
251 | KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); | 251 | KConfig* con = new KConfig( locateLocal("config", "syncContactrc") ); |
252 | con->setGroup( "General" ); | 252 | con->setGroup( "General" ); |
253 | con->writeEntry( "ResourceKeys", QString("sync") ); | 253 | con->writeEntry( "ResourceKeys", QString("sync") ); |
254 | con->writeEntry( "Standard", QString("sync") ); | 254 | con->writeEntry( "Standard", QString("sync") ); |
255 | con->setGroup( "Resource_sync" ); | 255 | con->setGroup( "Resource_sync" ); |
256 | con->writeEntry( "FileName", config ); | 256 | con->writeEntry( "FileName", config ); |
257 | con->writeEntry( "FileFormat", QString("vcard") ); | 257 | con->writeEntry( "FileFormat", QString("vcard") ); |
258 | con->writeEntry( "ResourceIdentifier", QString("sync") ); | 258 | con->writeEntry( "ResourceIdentifier", QString("sync") ); |
259 | con->writeEntry( "ResourceName", QString("sync_res") ); | 259 | con->writeEntry( "ResourceName", QString("sync_res") ); |
260 | if ( config.right(4) == ".xml" ) | 260 | if ( config.right(4) == ".xml" ) |
261 | con->writeEntry( "ResourceType", QString("qtopia") ); | 261 | con->writeEntry( "ResourceType", QString("qtopia") ); |
262 | else if ( config == "sharp" ) { | 262 | else if ( config == "sharp" ) { |
263 | con->writeEntry( "ResourceType", QString("sharp") ); | 263 | con->writeEntry( "ResourceType", QString("sharp") ); |
264 | } else { | 264 | } else { |
265 | con->writeEntry( "ResourceType", QString("file") ); | 265 | con->writeEntry( "ResourceType", QString("file") ); |
266 | } | 266 | } |
267 | //con->sync(); | 267 | //con->sync(); |
268 | d->mConfig = con; | 268 | d->mConfig = con; |
269 | } | 269 | } |
270 | else | 270 | else |
271 | d->mConfig = new KConfig( locateLocal("config", config) ); | 271 | d->mConfig = new KConfig( locateLocal("config", config) ); |
272 | // qDebug("AddressBook::init 1 config=%s",config.latin1() ); | 272 | // qDebug("AddressBook::init 1 config=%s",config.latin1() ); |
273 | } | 273 | } |
274 | else { | 274 | else { |
275 | d->mConfig = 0; | 275 | d->mConfig = 0; |
276 | // qDebug("AddressBook::init 1 config=0"); | 276 | // qDebug("AddressBook::init 1 config=0"); |
277 | } | 277 | } |
278 | 278 | ||
279 | //US d->mErrorHandler = 0; | 279 | //US d->mErrorHandler = 0; |
280 | d->mManager = new KRES::Manager<Resource>( fami, false ); | 280 | d->mManager = new KRES::Manager<Resource>( fami ); |
281 | d->mManager->readConfig( d->mConfig ); | 281 | d->mManager->readConfig( d->mConfig ); |
282 | if ( family == "syncContact" ) { | 282 | if ( family == "syncContact" ) { |
283 | KRES::Manager<Resource> *manager = d->mManager; | 283 | KRES::Manager<Resource> *manager = d->mManager; |
284 | KRES::Manager<Resource>::ActiveIterator it; | 284 | KRES::Manager<Resource>::ActiveIterator it; |
285 | for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { | 285 | for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { |
286 | (*it)->setAddressBook( this ); | 286 | (*it)->setAddressBook( this ); |
287 | if ( !(*it)->open() ) | 287 | if ( !(*it)->open() ) |
288 | error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); | 288 | error( QString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); |
289 | } | 289 | } |
290 | Resource *res = standardResource(); | 290 | Resource *res = standardResource(); |
291 | if ( !res ) { | 291 | if ( !res ) { |
292 | qDebug("ERROR: no standard resource"); | 292 | qDebug("ERROR: no standard resource"); |
293 | res = manager->createResource( "file" ); | 293 | res = manager->createResource( "file" ); |
294 | if ( res ) | 294 | if ( res ) |
295 | { | 295 | { |
296 | addResource( res ); | 296 | addResource( res ); |
297 | } | 297 | } |
298 | else | 298 | else |
299 | qDebug(" No resource available!!!"); | 299 | qDebug(" No resource available!!!"); |
300 | } | 300 | } |
301 | setStandardResource( res ); | 301 | setStandardResource( res ); |
302 | manager->writeConfig(); | 302 | manager->writeConfig(); |
303 | } | 303 | } |
304 | addCustomField( i18n( "Department" ), KABC::Field::Organization, | 304 | addCustomField( i18n( "Department" ), KABC::Field::Organization, |
305 | "X-Department", "KADDRESSBOOK" ); | 305 | "X-Department", "KADDRESSBOOK" ); |
306 | addCustomField( i18n( "Profession" ), KABC::Field::Organization, | 306 | addCustomField( i18n( "Profession" ), KABC::Field::Organization, |
307 | "X-Profession", "KADDRESSBOOK" ); | 307 | "X-Profession", "KADDRESSBOOK" ); |
308 | addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, | 308 | addCustomField( i18n( "Assistant's Name" ), KABC::Field::Organization, |
309 | "X-AssistantsName", "KADDRESSBOOK" ); | 309 | "X-AssistantsName", "KADDRESSBOOK" ); |
310 | addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, | 310 | addCustomField( i18n( "Manager's Name" ), KABC::Field::Organization, |
311 | "X-ManagersName", "KADDRESSBOOK" ); | 311 | "X-ManagersName", "KADDRESSBOOK" ); |
312 | addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, | 312 | addCustomField( i18n( "Spouse's Name" ), KABC::Field::Personal, |