author | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-08-01 12:56:11 (UTC) |
commit | cc2643f4be54269db8c24f66fdcbbf6954d5f537 (patch) (unidiff) | |
tree | 3562598dac624305dfb9fd1911a4b314ae40945d /korganizer/kosyncprefsdialog.cpp | |
parent | c31e99f265dbe8762efca20667f8ccd973840f8f (diff) | |
download | kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.zip kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.gz kdepimpi-cc2643f4be54269db8c24f66fdcbbf6954d5f537.tar.bz2 |
Made sync profile dialog korganizer independent
Diffstat (limited to 'korganizer/kosyncprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/kosyncprefsdialog.cpp | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/korganizer/kosyncprefsdialog.cpp b/korganizer/kosyncprefsdialog.cpp index b7e4265..7c838f5 100644 --- a/korganizer/kosyncprefsdialog.cpp +++ b/korganizer/kosyncprefsdialog.cpp | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <qfont.h> | 29 | #include <qfont.h> |
30 | #include <qslider.h> | 30 | #include <qslider.h> |
31 | #include <qfile.h> | 31 | #include <qfile.h> |
32 | #include <qdir.h> | ||
32 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
33 | #include <qcombobox.h> | 34 | #include <qcombobox.h> |
34 | #include <qvbox.h> | 35 | #include <qvbox.h> |
@@ -59,10 +60,10 @@ | |||
59 | #include <libkdepim/ksyncprofile.h> | 60 | #include <libkdepim/ksyncprofile.h> |
60 | 61 | ||
61 | 62 | ||
62 | #include "koprefs.h" | 63 | //#include "koprefs.h" |
63 | 64 | ||
64 | #include "kosyncprefsdialog.h" | 65 | #include "kosyncprefsdialog.h" |
65 | #include "koglobals.h" | 66 | //#include "koglobals.h" |
66 | 67 | ||
67 | 68 | ||
68 | KOSyncPrefsDialog::KOSyncPrefsDialog(QWidget *parent, char *name, bool modal) : | 69 | KOSyncPrefsDialog::KOSyncPrefsDialog(QWidget *parent, char *name, bool modal) : |
@@ -233,7 +234,7 @@ void KOSyncPrefsDialog::accept() | |||
233 | } | 234 | } |
234 | void KOSyncPrefsDialog::chooseFile() | 235 | void KOSyncPrefsDialog::chooseFile() |
235 | { | 236 | { |
236 | QString fn =KOPrefs::instance()->mLastSyncedLocalFile; | 237 | QString fn = QDir::homeDirPath(); |
237 | 238 | ||
238 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); | 239 | fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); |
239 | if ( fn == "" ) | 240 | if ( fn == "" ) |
@@ -413,23 +414,37 @@ void KOSyncPrefsDialog::cloneProfile() | |||
413 | newProfile(); | 414 | newProfile(); |
414 | } | 415 | } |
415 | 416 | ||
417 | void KOSyncPrefsDialog::setLocalMachineName ( const QString& name ) | ||
418 | { | ||
419 | mMyMachineName->setText( name ); | ||
416 | 420 | ||
421 | } | ||
422 | QString KOSyncPrefsDialog::getLocalMachineName ( ) | ||
423 | { | ||
424 | return mMyMachineName->text(); | ||
425 | } | ||
426 | |||
427 | QStringList KOSyncPrefsDialog::getSyncProfileNames() | ||
428 | { | ||
429 | return mSyncProfileNames; | ||
430 | } | ||
417 | void KOSyncPrefsDialog::usrReadConfig() | 431 | void KOSyncPrefsDialog::usrReadConfig() |
418 | { | 432 | { |
419 | KConfig *config = KOGlobals::config(); | 433 | //KConfig *config = KOGlobals::config(); |
420 | config->setGroup("SyncProfiles"); | 434 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
421 | mSyncProfileNames = KOPrefs::instance()->mSyncProfileNames; | 435 | config.setGroup("SyncProfiles"); |
436 | mSyncProfileNames =config.readListEntry("SyncProfileNames"); | ||
422 | int i; | 437 | int i; |
423 | KSyncProfile* temp ; | 438 | KSyncProfile* temp ; |
424 | mSyncProfiles.clear(); | 439 | mSyncProfiles.clear(); |
425 | for ( i = 0; i < mSyncProfileNames.count();++i ) { | 440 | for ( i = 0; i < mSyncProfileNames.count();++i ) { |
426 | temp = new KSyncProfile (); | 441 | temp = new KSyncProfile (); |
427 | temp->setName( mSyncProfileNames[i] ); | 442 | temp->setName( mSyncProfileNames[i] ); |
428 | temp->readConfig( config ); | 443 | temp->readConfig( &config ); |
429 | mSyncProfiles.append( temp ); | 444 | mSyncProfiles.append( temp ); |
430 | } | 445 | } |
431 | insertProfiles(); | 446 | insertProfiles(); |
432 | mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); | 447 | //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); |
433 | } | 448 | } |
434 | 449 | ||
435 | 450 | ||
@@ -438,15 +453,16 @@ void KOSyncPrefsDialog::usrWriteConfig() | |||
438 | saveProfile(); | 453 | saveProfile(); |
439 | if ( currentSelection >= 0 ) | 454 | if ( currentSelection >= 0 ) |
440 | profileChanged(currentSelection); | 455 | profileChanged(currentSelection); |
441 | KConfig *config = KOGlobals::config(); | 456 | //KConfig *config = KOGlobals::config(); |
442 | config->setGroup("SyncProfiles"); | 457 | KConfig config ( locateLocal( "config","syncprofilesrc" ) ); |
458 | config.setGroup("SyncProfiles"); | ||
443 | KSyncProfile* prof = mSyncProfiles.first(); | 459 | KSyncProfile* prof = mSyncProfiles.first(); |
444 | while ( prof ) { | 460 | while ( prof ) { |
445 | prof->writeConfig(config); | 461 | prof->writeConfig(&config); |
446 | prof = mSyncProfiles.next(); | 462 | prof = mSyncProfiles.next(); |
447 | } | 463 | } |
448 | KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; | 464 | //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; |
449 | KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); | 465 | //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); |
450 | config->writeEntry("SyncProfileNames",&mSyncProfileNames); | 466 | config.writeEntry("SyncProfileNames",&mSyncProfileNames); |
451 | } | 467 | } |
452 | 468 | ||