From 40eaafc9e008dc004b6ebc65fae8d89c8883ee8b Mon Sep 17 00:00:00 2001 From: zautrix Date: Wed, 20 Oct 2004 08:47:06 +0000 Subject: config save bugfix --- (limited to 'libkdepim') diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp index 75c0b2b..7ca3ee0 100644 --- a/libkdepim/ksyncmanager.cpp +++ b/libkdepim/ksyncmanager.cpp @@ -273,6 +273,7 @@ void KSyncManager::slotSyncMenu( int action ) void KSyncManager::enableQuick( bool ask ) { bool autoStart; + bool changed = false; if ( ask ) { QDialog dia ( 0, "input-dialog", true ); QLineEdit lab ( &dia ); @@ -316,13 +317,24 @@ void KSyncManager::enableQuick( bool ask ) return; dia.hide(); qApp->processEvents(); - mPrefs->mPassiveSyncPw = lepw.text(); - mPrefs->mPassiveSyncPort = lab.text(); + if ( mPrefs->mPassiveSyncPw != lepw.text() ) { + changed = true; + mPrefs->mPassiveSyncPw = lepw.text(); + } + if ( mPrefs->mPassiveSyncPort != lab.text() ) { + mPrefs->mPassiveSyncPort = lab.text(); + changed = true; + } autoStart = autostart.isChecked(); - mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked(); + if (mPrefs->mPassiveSyncWithDesktop != syncdesktop.isChecked() ) { + changed = true; + mPrefs->mPassiveSyncWithDesktop = syncdesktop.isChecked(); + } } else autoStart = mPrefs->mPassiveSyncAutoStart; + if ( autoStart != mPrefs->mPassiveSyncAutoStart ) + changed = true; bool ok; mPrefs->mPassiveSyncAutoStart = false; Q_UINT16 port = mPrefs->mPassiveSyncPort.toUInt(&ok); @@ -340,8 +352,10 @@ void KSyncManager::enableQuick( bool ask ) mServerSocket = 0; return; } - mPrefs->mPassiveSyncAutoStart = autoStart; + if ( changed ) { + mPrefs->writeConfig(); + } connect( mServerSocket, SIGNAL ( request_file() ),this, SIGNAL ( request_file() ) ); connect( mServerSocket, SIGNAL ( file_received( bool ) ), this, SIGNAL ( getFile( bool ) ) ); } -- cgit v0.9.0.2