Remove ancient settings migration code
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 29 May 2018 19:26:24 +0000 (21:26 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 6 Jun 2018 19:12:17 +0000 (21:12 +0200)
Nobody should be running Quassel 0.3 anymore in this decade, so
remove ancient and messy config location migration code.

src/core/core.cpp
src/qtui/qtuiapplication.cpp

index 1e5fe02..f793855 100644 (file)
@@ -98,73 +98,6 @@ Core::Core()
 
     Quassel::loadTranslation(QLocale::system());
 
-    // FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
-    // Move settings, note this does not delete the old files
-#ifdef Q_OS_MAC
-    QSettings newSettings("quassel-irc.org", "quasselcore");
-#else
-
-# ifdef Q_OS_WIN
-    QSettings::Format format = QSettings::IniFormat;
-# else
-    QSettings::Format format = QSettings::NativeFormat;
-# endif
-    QString newFilePath = Quassel::configDirPath() + "quasselcore"
-                          + ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
-    QSettings newSettings(newFilePath, format);
-#endif /* Q_OS_MAC */
-
-    if (newSettings.value("Config/Version").toUInt() == 0) {
-#   ifdef Q_OS_MAC
-        QString org = "quassel-irc.org";
-#   else
-        QString org = "Quassel Project";
-#   endif
-        QSettings oldSettings(org, "Quassel Core");
-        if (oldSettings.allKeys().count()) {
-            quWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your core settings...";
-            foreach(QString key, oldSettings.allKeys())
-            newSettings.setValue(key, oldSettings.value(key));
-            newSettings.setValue("Config/Version", 1);
-            quWarning() << "*   Your core settings have been migrated to" << newSettings.fileName();
-
-#ifndef Q_OS_MAC /* we don't need to move the db and cert for mac */
-#ifdef Q_OS_WIN
-            QString quasselDir = qgetenv("APPDATA") + "/quassel/";
-#elif defined Q_OS_MAC
-            QString quasselDir = QDir::homePath() + "/Library/Application Support/Quassel/";
-#else
-            QString quasselDir = QDir::homePath() + "/.quassel/";
-#endif
-
-            QFileInfo info(Quassel::configDirPath() + "quassel-storage.sqlite");
-            if (!info.exists()) {
-                // move database, if we found it
-                QFile oldDb(quasselDir + "quassel-storage.sqlite");
-                if (oldDb.exists()) {
-                    bool success = oldDb.rename(Quassel::configDirPath() + "quassel-storage.sqlite");
-                    if (success)
-                        quWarning() << "*   Your database has been moved to" << Quassel::configDirPath() + "quassel-storage.sqlite";
-                    else
-                        quWarning() << "!!! Moving your database has failed. Please move it manually into" << Quassel::configDirPath();
-                }
-            }
-            // move certificate
-            QFileInfo certInfo(quasselDir + "quasselCert.pem");
-            if (certInfo.exists()) {
-                QFile cert(quasselDir + "quasselCert.pem");
-                bool success = cert.rename(Quassel::configDirPath() + "quasselCert.pem");
-                if (success)
-                    quWarning() << "*   Your certificate has been moved to" << Quassel::configDirPath() + "quasselCert.pem";
-                else
-                    quWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
-            }
-#endif /* !Q_OS_MAC */
-            quWarning() << "*** Migration completed.\n\n";
-        }
-    }
-    // MIGRATION end
-
     // check settings version
     // so far, we only have 1
     CoreSettings s;
index 568cbc1..73e67b2 100644 (file)
@@ -103,42 +103,6 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
 bool QtUiApplication::init()
 {
     if (Quassel::init()) {
-        // FIXME: MIGRATION 0.3 -> 0.4: Move database and core config to new location
-        // Move settings, note this does not delete the old files
-#ifdef Q_OS_MAC
-        QSettings newSettings("quassel-irc.org", "quasselclient");
-#else
-
-# ifdef Q_OS_WIN
-        QSettings::Format format = QSettings::IniFormat;
-# else
-        QSettings::Format format = QSettings::NativeFormat;
-# endif
-
-        QString newFilePath = Quassel::configDirPath() + "quasselclient"
-                              + ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
-        QSettings newSettings(newFilePath, format);
-#endif /* Q_OS_MAC */
-
-        if (newSettings.value("Config/Version").toUInt() == 0) {
-#     ifdef Q_OS_MAC
-            QString org = "quassel-irc.org";
-#     else
-            QString org = "Quassel Project";
-#     endif
-            QSettings oldSettings(org, "Quassel Client");
-            if (oldSettings.allKeys().count()) {
-                qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your client settings...";
-                foreach(QString key, oldSettings.allKeys())
-                newSettings.setValue(key, oldSettings.value(key));
-                newSettings.setValue("Config/Version", 1);
-                qWarning() << "*   Your client settings have been migrated to" << newSettings.fileName();
-                qWarning() << "*** Migration completed.\n\n";
-            }
-        }
-
-        // MIGRATION end
-
         // Settings upgrade/downgrade handling
         if (!migrateSettings()) {
             qCritical() << "Could not load or upgrade client settings, terminating!";