Diffstat (limited to 'libkdepim/ksyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/ksyncprefsdialog.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libkdepim/ksyncprefsdialog.cpp b/libkdepim/ksyncprefsdialog.cpp index 8d610d8..3df2a3b 100644 --- a/libkdepim/ksyncprefsdialog.cpp +++ b/libkdepim/ksyncprefsdialog.cpp | |||
@@ -405,64 +405,67 @@ void KSyncPrefsDialog::newProfile() | |||
405 | { | 405 | { |
406 | addProfile ( new KSyncProfile () ); | 406 | addProfile ( new KSyncProfile () ); |
407 | } | 407 | } |
408 | 408 | ||
409 | void KSyncPrefsDialog::cloneProfile() | 409 | void KSyncPrefsDialog::cloneProfile() |
410 | { | 410 | { |
411 | if ( currentSelection >= 0 ) | 411 | if ( currentSelection >= 0 ) |
412 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; | 412 | addProfile (mSyncProfiles.at(currentSelection)->clone()) ; |
413 | else | 413 | else |
414 | newProfile(); | 414 | newProfile(); |
415 | } | 415 | } |
416 | 416 | ||
417 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) | 417 | void KSyncPrefsDialog::setLocalMachineName ( const QString& name ) |
418 | { | 418 | { |
419 | mMyMachineName->setText( name ); | 419 | mMyMachineName->setText( name ); |
420 | 420 | ||
421 | } | 421 | } |
422 | QString KSyncPrefsDialog::getLocalMachineName ( ) | 422 | QString KSyncPrefsDialog::getLocalMachineName ( ) |
423 | { | 423 | { |
424 | return mMyMachineName->text(); | 424 | return mMyMachineName->text(); |
425 | } | 425 | } |
426 | 426 | ||
427 | QStringList KSyncPrefsDialog::getSyncProfileNames() | 427 | QStringList KSyncPrefsDialog::getSyncProfileNames() |
428 | { | 428 | { |
429 | return mSyncProfileNames; | 429 | return mSyncProfileNames; |
430 | } | 430 | } |
431 | void KSyncPrefsDialog::usrReadConfig() | 431 | void KSyncPrefsDialog::usrReadConfig() |
432 | { | 432 | { |
433 | //KConfig *config = KOGlobals::config(); | 433 | //KConfig *config = KOGlobals::config(); |
434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
435 | config.setGroup("SyncProfiles"); | 435 | config.setGroup("SyncProfiles"); |
436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | 436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); |
437 | mMyMachineName->setText(config.readEntry("LocalMachineName","undefined")); | ||
437 | int i; | 438 | int i; |
438 | KSyncProfile* temp ; | 439 | KSyncProfile* temp ; |
439 | mSyncProfiles.clear(); | 440 | mSyncProfiles.clear(); |
440 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 441 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
441 | temp = new KSyncProfile (); | 442 | temp = new KSyncProfile (); |
442 | temp->setName( mSyncProfileNames[i] ); | 443 | temp->setName( mSyncProfileNames[i] ); |
443 | temp->readConfig( &config ); | 444 | temp->readConfig( &config ); |
444 | mSyncProfiles.append( temp ); | 445 | mSyncProfiles.append( temp ); |
445 | } | 446 | } |
446 | insertProfiles(); | 447 | insertProfiles(); |
447 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 448 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
448 | } | 449 | } |
449 | 450 | ||
450 | 451 | ||
451 | void KSyncPrefsDialog::usrWriteConfig() | 452 | void KSyncPrefsDialog::usrWriteConfig() |
452 | { | 453 | { |
453 | saveProfile(); | 454 | saveProfile(); |
454 | if ( currentSelection >= 0 ) | 455 | if ( currentSelection >= 0 ) |
455 | profileChanged(currentSelection); | 456 | profileChanged(currentSelection); |
456 | //KConfig *config = KOGlobals::config(); | 457 | //KConfig *config = KOGlobals::config(); |
457 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); | 458 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
458 | config.setGroup("SyncProfiles"); | 459 | config.setGroup("SyncProfiles"); |
459 | KSyncProfile* prof = mSyncProfiles.first(); | 460 | KSyncProfile* prof = mSyncProfiles.first(); |
460 | while ( prof ) { | 461 | while ( prof ) { |
461 | prof->writeConfig(&config); | 462 | prof->writeConfig(&config); |
462 | prof = mSyncProfiles.next(); | 463 | prof = mSyncProfiles.next(); |
463 | } | 464 | } |
464 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 465 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
465 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 466 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
466 | config.writeEntry("SyncProfileNames",&mSyncProfileNames); | 467 | config.writeEntry("SyncProfileNames",mSyncProfileNames); |
468 | QString name = mMyMachineName->text(); | ||
469 | config.writeEntry("LocalMachineName",name); | ||
467 | } | 470 | } |
468 | 471 | ||