Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index ff1e240..764c495 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -198,7 +198,7 @@ void KDEPIMConfigWidget::setupStoreTab() | |||
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | #endif | 201 | #endif |
202 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 202 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
203 | QHBox *bb = new QHBox( storePage ); | 203 | QHBox *bb = new QHBox( storePage ); |
204 | QPushButton * pb; | 204 | QPushButton * pb; |
@@ -214,8 +214,14 @@ void KDEPIMConfigWidget::setupStoreTab() | |||
214 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); | 214 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); |
215 | #endif | 215 | #endif |
216 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 216 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
217 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 217 | mDataStoragePath = new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
218 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 218 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
219 | |||
220 | #ifdef DESKTOP_VERSION | ||
221 | if ( mStoreUrl->url().startsWith( "LOCAL:" ) ) { | ||
222 | mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( qApp->applicationDirPath ()+"/.microkdehome" )); | ||
223 | } | ||
224 | #endif | ||
219 | } | 225 | } |
220 | void KDEPIMConfigWidget::setLocalStore() | 226 | void KDEPIMConfigWidget::setLocalStore() |
221 | { | 227 | { |
@@ -231,6 +237,17 @@ void KDEPIMConfigWidget::setStandardStore() | |||
231 | } | 237 | } |
232 | void KDEPIMConfigWidget::saveStoreSettings() | 238 | void KDEPIMConfigWidget::saveStoreSettings() |
233 | { | 239 | { |
240 | #ifdef DESKTOP_VERSION | ||
241 | if ( !mStoreUrl->url().startsWith( "LOCAL:" ) ) { | ||
242 | QString file = qApp->applicationDirPath ()+"/.microkdehome"; | ||
243 | QFileInfo fi ( file ); | ||
244 | if ( fi.exists() ) { | ||
245 | bool res = QFile::remove( file ); | ||
246 | if ( ! res ) | ||
247 | KMessageBox::information( this, i18n("ERROR: Cannot remove file\n%1\nPlease remove it manually.").arg( file )); | ||
248 | } | ||
249 | } | ||
250 | #endif | ||
234 | if ( !mStoreUrl->url().isEmpty() ) { | 251 | if ( !mStoreUrl->url().isEmpty() ) { |
235 | QString path = QDir::homeDirPath(); | 252 | QString path = QDir::homeDirPath(); |
236 | QString url = mStoreUrl->url(); | 253 | QString url = mStoreUrl->url(); |
@@ -244,6 +261,7 @@ void KDEPIMConfigWidget::saveStoreSettings() | |||
244 | cfg.writeEntry( "MICROKDEHOME", url ); | 261 | cfg.writeEntry( "MICROKDEHOME", url ); |
245 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); | 262 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
246 | cfg.sync(); | 263 | cfg.sync(); |
264 | mDataStoragePath->setText( i18n("Settings are stored in\n%1").arg( path+"/.microkdehome" )); | ||
247 | } else { | 265 | } else { |
248 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 266 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
249 | saveStoreSettings(); | 267 | saveStoreSettings(); |
@@ -841,8 +859,10 @@ void KDEPIMConfigWidget::usrReadConfig() | |||
841 | 859 | ||
842 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) | 860 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) |
843 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 861 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
844 | else | 862 | else { |
845 | mBackupUrl->setURL(prefs->mBackupDatadir); | 863 | mBackupUrl->setURL(prefs->mBackupDatadir); |
864 | |||
865 | } | ||
846 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); | 866 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); |
847 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); | 867 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); |
848 | 868 | ||