summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt9
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp38
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h5
-rw-r--r--microkde/kdecore/kstandarddirs.cpp4
-rw-r--r--microkde/kdecore/kstandarddirs.h2
5 files changed, 55 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 683de7c..c0078be 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -20,2 +20,8 @@ Same for shared addressbooks.
+Added a setting for the global kdepim data storage.
+Usually the data is stored in (yourhomedir/kdepim).
+Now you can set in the Global config dialog TAB, subTAB "Data storage path"
+a directory where all the kdepim data is stored.
+That makes it easy to save all kdepim data on a SD card on the Z, for example.
+
KO/Pi:
@@ -34,3 +40,4 @@ Parsing data fix of KA/Pi version 1.9.17.
Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
-
+Fixed some syncing merging problems.
+
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 20594c6..d097078 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -38,2 +38,4 @@ $Id$
#include <qfile.h>
+#include <qvbox.h>
+#include <qdir.h>
#include <qregexp.h>
@@ -105,2 +107,3 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent,
setupExternalAppTab();
+ setupStoreTab();
@@ -111,2 +114,37 @@ void KDEPIMConfigWidget::showTimeZoneTab()
}
+void KDEPIMConfigWidget::setupStoreTab()
+{
+ QVBox *storePage = new QVBox( this );
+ new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
+ new QLabel( i18n("<b>Set new data storage dir:</b>"), storePage );
+ mStoreUrl = new KURLRequester( storePage );
+ mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
+ new QLabel( i18n("Not existing dirs are created automatically"), storePage );
+ QHBox *bb = new QHBox( storePage );
+ QPushButton * pb = new QPushButton ( i18n("Save settings"), bb );
+ connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
+ pb = new QPushButton ( i18n("Save standard"), bb );
+ connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
+ new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
+ new QLabel( i18n("The settings of the storage\ndir is saved in the file\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
+ tabWidget->addTab( storePage, i18n( "Data storage path" ) );
+}
+void KDEPIMConfigWidget::setStandardStore()
+{
+ mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
+ saveStoreSettings();
+}
+void KDEPIMConfigWidget::saveStoreSettings()
+{
+ if ( !mStoreUrl->url().isEmpty() ) {
+ KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
+ cfg.setGroup("Global");
+ cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
+ qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
+ cfg.sync();
+ } else {
+ mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
+ saveStoreSettings();
+ }
+}
void KDEPIMConfigWidget::setupExternalAppTab()
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index 619f3d7..c545207 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -34,2 +34,3 @@ $Id$
#include <kprefswidget.h>
+#include <kio/kfile/kurlrequester.h>
#include <qmap.h>
@@ -70,2 +71,4 @@ class KDEPIMConfigWidget : public KPrefsWidget
void externalapp_changed( int newApp );
+ void saveStoreSettings();
+ void setStandardStore();
@@ -76,2 +79,4 @@ class KDEPIMConfigWidget : public KPrefsWidget
void setupTimeZoneTab();
+ void setupStoreTab();
+ KURLRequester* mStoreUrl;
diff --git a/microkde/kdecore/kstandarddirs.cpp b/microkde/kdecore/kstandarddirs.cpp
index 4c03c15..f3584d7 100644
--- a/microkde/kdecore/kstandarddirs.cpp
+++ b/microkde/kdecore/kstandarddirs.cpp
@@ -1285,3 +1285,5 @@ void KStandardDirs::addKDEDefaults()
{
- localKdeDir = QDir::homeDirPath() + "/kdepim/";
+ KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
+ cfg.setGroup("Global");
+ localKdeDir = cfg.readEntry( "MICROKDEHOME", QDir::homeDirPath() + "/kdepim/" );
}
diff --git a/microkde/kdecore/kstandarddirs.h b/microkde/kdecore/kstandarddirs.h
index c4e1108..bee864e 100644
--- a/microkde/kdecore/kstandarddirs.h
+++ b/microkde/kdecore/kstandarddirs.h
@@ -570,3 +570,3 @@ public:
static QString appDir();
-
+
private: