summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp28
-rw-r--r--libkdepim/kpimglobalprefs.cpp6
-rw-r--r--libkdepim/kpimprefs.cpp3
-rw-r--r--libkdepim/kpimprefs.h1
4 files changed, 32 insertions, 6 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
@@ -133,5 +133,5 @@ void KDEPIMConfigWidget::setupBackupTab()
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame); 135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 137 mBackupUrl = new KURLRequester( bupFrame );
@@ -140,5 +140,6 @@ void KDEPIMConfigWidget::setupBackupTab()
140 bupLayout->addWidget( mBackupUrl ); 140 bupLayout->addWidget( mBackupUrl );
141 141
142 142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
143 QHBox *dummy = new QHBox(bupFrame); 144 QHBox *dummy = new QHBox(bupFrame);
144 new QLabel(i18n("Number of Backups:"),dummy); 145 new QLabel(i18n("Number of Backups:"),dummy);
@@ -152,5 +153,13 @@ void KDEPIMConfigWidget::setupBackupTab()
152 new QLabel(i18n(" days"),dummy); 153 new QLabel(i18n(" days"),dummy);
153 new QLabel(i18n(" "),dummy); 154 new QLabel(i18n(" "),dummy);
154 bupLayout->addWidget( dummy ); 155 bupLayout->addWidget( dummy );
156 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 }
155 164
156} 165}
@@ -807,4 +816,11 @@ void KDEPIMConfigWidget::usrReadConfig()
807 blockSignals( true ); 816 blockSignals( true );
808 817
818 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir )
819 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
820 else
821 mBackupUrl->setURL(prefs->mBackupDatadir);
822 mBackupNumbersSpin->setValue( prefs->mBackupNumbers );
823 mBackupDayCountSpin->setValue( prefs->mBackupDayCount);
824
809 QString dummy = prefs->mUserDateFormatLong; 825 QString dummy = prefs->mUserDateFormatLong;
810 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 826 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
@@ -817,7 +833,4 @@ void KDEPIMConfigWidget::usrReadConfig()
817 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 833 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
818 834
819
820
821
822 mEmailClient = prefs->mEmailClient; 835 mEmailClient = prefs->mEmailClient;
823 mEmailOtherChannel = prefs->mEmailOtherChannel; 836 mEmailOtherChannel = prefs->mEmailOtherChannel;
@@ -867,4 +880,7 @@ void KDEPIMConfigWidget::usrWriteConfig()
867 saveEditFieldSettings(); 880 saveEditFieldSettings();
868 881
882 prefs->mBackupNumbers = mBackupNumbersSpin->value();
883 prefs->mBackupDayCount = mBackupDayCountSpin->value();
884 prefs->mBackupDatadir = mBackupUrl->url();
869 885
870 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 886 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 90321b2..9c28425 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -201,4 +201,10 @@ void KPimGlobalPrefs::setGlobalConfig()
201 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min ); 201 KGlobal::locale()->setTimezone( mTimeZoneId, mTimeZoneAdd30min );
202 KGlobalSettings::setAlternateBackgroundColor(mAlternateColor); 202 KGlobalSettings::setAlternateBackgroundColor(mAlternateColor);
203 QString localKdeDir;
204 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
205 if ( ! localKdeDir.isEmpty() ) {
206 mBackupUseDefaultDir = true;
207 mBackupDatadir = KGlobalSettings::backupDataDir();
208 }
203 209
204} 210}
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp
index d68ccb6..714d1b7 100644
--- a/libkdepim/kpimprefs.cpp
+++ b/libkdepim/kpimprefs.cpp
@@ -51,4 +51,7 @@ KPimPrefs::KPimPrefs( const QString &name ) :
51 addItemBool("PassiveSyncAutoStart",&mPassiveSyncAutoStart,false ); 51 addItemBool("PassiveSyncAutoStart",&mPassiveSyncAutoStart,false );
52 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3); 52 addItemInt("RingSyncAlgoPrefs",&mRingSyncAlgoPrefs,3);
53
54 setCurrentGroup("BackupDate");
55 addItemInt("LastBackupDate",&mLastBackupDate,0);
53} 56}
54 57
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h
index c177bd6..bf80042 100644
--- a/libkdepim/kpimprefs.h
+++ b/libkdepim/kpimprefs.h
@@ -62,4 +62,5 @@ class KPimPrefs : public KPrefs
62 int mRingSyncAlgoPrefs; 62 int mRingSyncAlgoPrefs;
63 QString mLastSyncedLocalFile; 63 QString mLastSyncedLocalFile;
64 int mLastBackupDate;
64 65
65 66