This should fix config file migration for the mac.
[quassel.git] / src / core / core.cpp
index bf0395e..9c92faf 100644 (file)
@@ -57,16 +57,21 @@ Core::Core() : storage(0) {
 
   // 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_WS_WIN
-  QSettings::Format format = QSettings::IniFormat;
+#ifdef Q_WS_MAC
+    QSettings newSettings("quassel-irc.org", "quasselcore");
 #else
-  QSettings::Format format = QSettings::NativeFormat;
-#endif
-  QString newFilePath = Quassel::configDirPath() + "quasselcore"
-  + ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
-  QSettings newSettings(newFilePath, format);
 
-  if(newSettings.value("General/Version").toUInt() != 1) {
+# ifdef Q_WS_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_WS_MAC */
+
+  if(newSettings.value("Config/Version").toUInt() != 1) {
     qWarning() << "\n\n*** IMPORTANT: Config and data file locations have changed. Attempting to auto-migrate your core settings...";
 #   ifdef Q_WS_MAC
     QString org = "quassel-irc.org";
@@ -80,6 +85,7 @@ Core::Core() : storage(0) {
       newSettings.setValue("Config/Version", 1);
       qWarning() << "*   Your core settings have been migrated to" << newFilePath;
 
+#ifndef Q_WS_MAC /* we don't need to move the db and cert for mac */
 #ifdef Q_OS_WIN32
       QString quasselDir = qgetenv("APPDATA") + "/quassel/";
 #elif defined Q_WS_MAC
@@ -113,7 +119,7 @@ Core::Core() : storage(0) {
       qWarning() << "*** Migration completed.\n\n";
     }
   }
-
+#endif /* !Q_WS_MAC */
   // MIGRATION end
 
   // Register storage backends here!