Add patch for KDE4 to KF5 config migration
authorAndre Heinecke <aheinecke@intevation.de>
Tue, 1 Mar 2016 16:51:51 +0000 (17:51 +0100)
committerAndre Heinecke <aheinecke@intevation.de>
Tue, 1 Mar 2016 16:51:51 +0000 (17:51 +0100)
* Makefile.am (EXTRA_DIST): Add patch.
* patches/kcoreaddons/
 0001-Fix-Kdelibs4-config-migration-for-Windows.patch: New.

--
This is KDE Review Request 127245

Makefile.am
patches/kcoreaddons/0001-Fix-Kdelibs4-config-migration-for-Windows.patch [new file with mode: 0755]

index 2bc639f..81dbec3 100644 (file)
@@ -37,6 +37,7 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/w32pth-2.0.5/workaround-broken-libtool.patch \
         patches/qttools/disable-most-tools.patch \
         patches/ki18n/no-tests.patch \
+        patches/gpgme-1.6.0/0001-w32-Fallback-to-2.1-reg-key-for-gpgconf-search.patch \
         patches/gpgmepp/0002-disable-variants.patch \
         patches/kmime/0001-Check-for-and-replace-strcasestr.patch \
         patches/kmime/0002-Fix-Windows-build.patch \
@@ -54,7 +55,8 @@ EXTRA_DIST = autogen.sh README.GIT ONEWS \
         patches/kleopatra/0002-Add-alternative-configuredialog-wihout-KCMUtils.patch \
         patches/kleopatra/0003-Add-option-to-disable-KWatchGnuPG.patch \
         patches/kleopatra/0004-Make-DBus-integration-of-the-smime-conf-optional.patch \
-        patches/kleopatra/0005-Hack-generated-conf-files-for-Crosscompiling.patch
+        patches/kleopatra/0005-Hack-generated-conf-files-for-Crosscompiling.patch \
+        patches/kcoreaddons/0001-Fix-Kdelibs4-config-migration-for-Windows.patch
 
 copy-news:
        cp NEWS doc/website/NEWS.last
diff --git a/patches/kcoreaddons/0001-Fix-Kdelibs4-config-migration-for-Windows.patch b/patches/kcoreaddons/0001-Fix-Kdelibs4-config-migration-for-Windows.patch
new file mode 100755 (executable)
index 0000000..87ed563
--- /dev/null
@@ -0,0 +1,46 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From 0de14a576faf93d0a540ce65aa4c5a5a203e35c7 Mon Sep 17 00:00:00 2001
+From: Andre Heinecke <aheinecke@intevation.de>
+Date: Tue, 1 Mar 2016 17:41:58 +0100
+Subject: [PATCH] Fix Kdelibs4 config migration for Windows
+
+Look for old config in ~/AppData/Roaming/.kde on Windows and
+use GenericConfigLocation instead of ConfigLocation for new
+config.
+---
+ src/lib/util/kdelibs4configmigrator.cpp | 2 +-
+ src/lib/util/kdelibs4migration.cpp      | 3 +++
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/util/kdelibs4configmigrator.cpp b/src/lib/util/kdelibs4configmigrator.cpp
+index c8560c1..acdb19c 100644
+--- a/src/lib/util/kdelibs4configmigrator.cpp
++++ b/src/lib/util/kdelibs4configmigrator.cpp
+@@ -72,7 +72,7 @@ bool Kdelibs4ConfigMigrator::migrate()
+
+     Q_FOREACH (const QString &configFileName, d->configFiles) {
+         const QString newConfigLocation
+-            = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)
++            = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)
+               + QLatin1Char('/') + configFileName;
+
+         if (QFile(newConfigLocation).exists()) {
+diff --git a/src/lib/util/kdelibs4migration.cpp b/src/lib/util/kdelibs4migration.cpp
+index f631efa..32a78c0 100644
+--- a/src/lib/util/kdelibs4migration.cpp
++++ b/src/lib/util/kdelibs4migration.cpp
+@@ -41,6 +41,9 @@ Kdelibs4Migration::Kdelibs4Migration()
+         QDir homeDir = QDir::home();
+         QVector<QString> testSubdirs;
+         testSubdirs << QStringLiteral(KDE4_DEFAULT_HOME) << QStringLiteral(".kde4") << QStringLiteral(".kde");
++#ifdef Q_OS_WIN
++        testSubdirs << QStringLiteral("AppData/Roaming/.kde");
++#endif
+         Q_FOREACH (const QString &testSubdir, testSubdirs) {
+             if (homeDir.exists(testSubdir)) {
+                 //qDebug() << "Using" << testSubdir << "as the location of the old config file";
+--
+2.1.4