Migrate KDE-specific settings from KDE4 to KF5
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 16 Feb 2015 22:05:55 +0000 (23:05 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 16 Feb 2015 22:05:55 +0000 (23:05 +0100)
This uses Kdelibs4ConfigMigrator to move over KDE-specific settings
(i.e. window state, shortcuts, notifications...) from the KDE4 config
dir to the one used by KF5. This should make the move seamless for
most intents and purposes.

Note that migration won't happen (again) once the KF5 config files
exist.

src/common/main.cpp

index 3f6cab5..6847371 100644 (file)
@@ -49,6 +49,7 @@
 #  include "kcmdlinewrapper.h"
 #elif defined HAVE_KF5
 #  include <KCoreAddons/KAboutData>
+#  include <KCoreAddons/Kdelibs4ConfigMigrator>
 #  include "qt5cliparser.h"
 #elif defined HAVE_QT5
 #  include "qt5cliparser.h"
@@ -102,6 +103,13 @@ int main(int argc, char **argv)
 # endif
 #endif
 
+    // Migrate settings from KDE4 to KF5 if appropriate
+#ifdef HAVE_KF5
+    Kdelibs4ConfigMigrator migrator(QCoreApplication::applicationName());
+    migrator.setConfigFiles(QStringList() << "quasselrc" << "quassel.notifyrc");
+    migrator.migrate();
+#endif
+
     AbstractCliParser *cliParser;
 
 #ifdef HAVE_KDE4