summaryrefslogtreecommitdiffabout
path: root/korganizer/kosyncprefsdialog.cpp
authorzautrix <zautrix>2004-08-01 12:56:11 (UTC)
committer zautrix <zautrix>2004-08-01 12:56:11 (UTC)
commitcc2643f4be54269db8c24f66fdcbbf6954d5f537 (patch) (side-by-side diff)
tree3562598dac624305dfb9fd1911a4b314ae40945d /korganizer/kosyncprefsdialog.cpp
parentc31e99f265dbe8762efca20667f8ccd973840f8f (diff)
downloadkdepimpi-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.cpp44
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 @@
#include <qfont.h>
#include <qslider.h>
#include <qfile.h>
+#include <qdir.h>
#include <qtextstream.h>
#include <qcombobox.h>
#include <qvbox.h>
@@ -59,10 +60,10 @@
#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) :
@@ -233,7 +234,7 @@ void KOSyncPrefsDialog::accept()
}
void KOSyncPrefsDialog::chooseFile()
{
- QString fn =KOPrefs::instance()->mLastSyncedLocalFile;
+ QString fn = QDir::homeDirPath();
fn =KFileDialog:: getOpenFileName( fn, i18n("Sync filename(*.ics/*.vcs)"), this );
if ( fn == "" )
@@ -413,23 +414,37 @@ void KOSyncPrefsDialog::cloneProfile()
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 );
}
@@ -438,15 +453,16 @@ 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);
}