summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-20 08:47:06 (UTC)
committer zautrix <zautrix>2004-10-20 08:47:06 (UTC)
commit40eaafc9e008dc004b6ebc65fae8d89c8883ee8b (patch) (side-by-side diff)
treeb2d60584f52ef66aa5347f2534d323a4609280c5
parent268e69a533c5db110600758366644c9827957364 (diff)
downloadkdepimpi-40eaafc9e008dc004b6ebc65fae8d89c8883ee8b.zip
kdepimpi-40eaafc9e008dc004b6ebc65fae8d89c8883ee8b.tar.gz
kdepimpi-40eaafc9e008dc004b6ebc65fae8d89c8883ee8b.tar.bz2
config save bugfix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--libkdepim/ksyncmanager.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/libkdepim/ksyncmanager.cpp b/libkdepim/ksyncmanager.cpp
index 75c0b2b..7ca3ee0 100644
--- a/libkdepim/ksyncmanager.cpp
+++ b/libkdepim/ksyncmanager.cpp
@@ -268,16 +268,17 @@ void KSyncManager::slotSyncMenu( int action )
}
delete temp;
setBlockSave(false);
}
void KSyncManager::enableQuick( bool ask )
{
bool autoStart;
+ bool changed = false;
if ( ask ) {
QDialog dia ( 0, "input-dialog", true );
QLineEdit lab ( &dia );
QVBoxLayout lay( &dia );
lab.setText( mPrefs->mPassiveSyncPort );
lay.setMargin(7);
lay.setSpacing(7);
int po = 9197+mTargetApp;
@@ -311,23 +312,34 @@ void KSyncManager::enableQuick( bool ask )
QPushButton pb ( "OK", &dia);
lay.addWidget( &pb );
connect(&pb, SIGNAL( clicked() ), &dia, SLOT ( accept() ) );
dia.show();
if ( ! dia.exec() )
return;
dia.hide();
qApp->processEvents();
+ 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();
+ 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);
if ( ! ok ) {
KMessageBox::information( 0, i18n("No valid port"));
return;
}
//qDebug("port %d ", port);
@@ -335,18 +347,20 @@ void KSyncManager::enableQuick( bool ask )
mServerSocket->setFileName( defaultFileName() );
//qDebug("connected ");
if ( !mServerSocket->ok() ) {
KMessageBox::information( 0, i18n("Failed to bind or\nlisten to the port!"));
delete mServerSocket;
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 ) ) );
}
void KSyncManager::syncLocalFile()
{
QString fn =mPrefs->mLastSyncedLocalFile;