-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 26 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 6 | ||||
-rw-r--r-- | libkdepim/kpimprefs.cpp | 3 | ||||
-rw-r--r-- | libkdepim/kpimprefs.h | 1 |
4 files changed, 31 insertions, 5 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index fbfbc45..93538ec 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -134,3 +134,3 @@ void KDEPIMConfigWidget::setupBackupTab() sb = addWidBool(i18n("Use standard backup dir"), - &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame); + &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); bupLayout->addWidget((QWidget*)sb->checkBox()); @@ -141,3 +141,4 @@ void KDEPIMConfigWidget::setupBackupTab() - + mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); + bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); QHBox *dummy = new QHBox(bupFrame); @@ -154,2 +155,10 @@ void KDEPIMConfigWidget::setupBackupTab() bupLayout->addWidget( dummy ); + QString localKdeDir; + localKdeDir = readEnvPath("LOCALMICROKDEHOME"); + if ( ! localKdeDir.isEmpty() ) { + sb->checkBox()->setEnabled( false ); + sb->checkBox()->setChecked( true ); + mBackupUrl->setEnabled( false ); + KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; + } @@ -808,2 +817,9 @@ void KDEPIMConfigWidget::usrReadConfig() + if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) + mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); + else + mBackupUrl->setURL(prefs->mBackupDatadir); + mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); + mBackupDayCountSpin->setValue( prefs->mBackupDayCount); + QString dummy = prefs->mUserDateFormatLong; @@ -818,5 +834,2 @@ void KDEPIMConfigWidget::usrReadConfig() - - - mEmailClient = prefs->mEmailClient; @@ -868,2 +881,5 @@ void KDEPIMConfigWidget::usrWriteConfig() + prefs->mBackupNumbers = mBackupNumbersSpin->value(); + prefs->mBackupDayCount = mBackupDayCountSpin->value(); + prefs->mBackupDatadir = mBackupUrl->url(); diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 90321b2..9c28425 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -202,2 +202,8 @@ void KPimGlobalPrefs::setGlobalConfig() KGlobalSettings::setAlternateBackgroundColor(mAlternateColor); + QString localKdeDir; + localKdeDir = readEnvPath("LOCALMICROKDEHOME"); + if ( ! localKdeDir.isEmpty() ) { + mBackupUseDefaultDir = true; + mBackupDatadir = KGlobalSettings::backupDataDir(); + } diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp index d68ccb6..714d1b7 100644 --- a/libkdepim/kpimprefs.cpp +++ b/libkdepim/kpimprefs.cpp @@ -52,2 +52,5 @@ KPimPrefs::KPimPrefs( const QString &name ) : addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); + + setCurrentGroup("BackupDate"); + addItemInt("LastBackupDate",&mLastBackupDate,0); } diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h index c177bd6..bf80042 100644 --- a/libkdepim/kpimprefs.h +++ b/libkdepim/kpimprefs.h @@ -63,2 +63,3 @@ class KPimPrefs : public KPrefs QString mLastSyncedLocalFile; + int mLastBackupDate; |