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 @@ -28,8 +28,9 @@ #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> +#include <qdir.h> #include <qtextstream.h> #include <qcombobox.h> #include <qvbox.h> #include <qhbox.h> @@ -58,12 +59,12 @@ #include <klineedit.h> #include <libkdepim/ksyncprofile.h> -#include "koprefs.h" +//#include "koprefs.h" #include "kosyncprefsdialog.h" -#include "koglobals.h" +//#include "koglobals.h" KOSyncPrefsDialog::KOSyncPrefsDialog(QWidget *parent, char *name, bool modal) : KDialog(parent,name,true) @@ -232,9 +233,9 @@ void KOSyncPrefsDialog::accept() slotOK(); } void KOSyncPrefsDialog::chooseFile() { - QString fn =KOPrefs::instance()->mLastSyncedLocalFile; + QString fn = QDir::homeDirPath(); fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this ); if ( fn == "" ) return; @@ -412,41 +413,56 @@ void KOSyncPrefsDialog::cloneProfile() else newProfile(); } +void KOSyncPrefsDialog::setLocalMachineName ( const QString& name ) +{ + mMyMachineName->setText( name ); +} +QString KOSyncPrefsDialog::getLocalMachineName ( ) +{ + return mMyMachineName->text(); +} + +QStringList KOSyncPrefsDialog::getSyncProfileNames() +{ + return mSyncProfileNames; +} void KOSyncPrefsDialog::usrReadConfig() { - KConfig *config = KOGlobals::config(); - config->setGroup("SyncProfiles"); - mSyncProfileNames = KOPrefs::instance()->mSyncProfileNames; + //KConfig *config = KOGlobals::config(); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + config.setGroup("SyncProfiles"); + mSyncProfileNames =config.readListEntry("SyncProfileNames"); int i; KSyncProfile* temp ; mSyncProfiles.clear(); for ( i = 0; i < mSyncProfileNames.count();++i ) { temp = new KSyncProfile (); temp->setName( mSyncProfileNames[i] ); - temp->readConfig( config ); + temp->readConfig( &config ); mSyncProfiles.append( temp ); } insertProfiles(); - mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); + //mMyMachineName->setText(KOPrefs::instance()->mLocalMachineName ); } void KOSyncPrefsDialog::usrWriteConfig() { saveProfile(); if ( currentSelection >= 0 ) profileChanged(currentSelection); - KConfig *config = KOGlobals::config(); - config->setGroup("SyncProfiles"); + //KConfig *config = KOGlobals::config(); + KConfig config ( locateLocal( "config","syncprofilesrc" ) ); + config.setGroup("SyncProfiles"); KSyncProfile* prof = mSyncProfiles.first(); while ( prof ) { - prof->writeConfig(config); + prof->writeConfig(&config); prof = mSyncProfiles.next(); } - KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; - KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); - config->writeEntry("SyncProfileNames",&mSyncProfileNames); + //KOPrefs::instance()->mSyncProfileNames = mSyncProfileNames; + //KOPrefs::instance()->mLocalMachineName = mMyMachineName->text(); + config.writeEntry("SyncProfileNames",&mSyncProfileNames); } |