X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=aa1b7d4899827139099d8bc31d86cccf6c822fda;hp=9c92faf105ee60d429e91ff48e1ca23cd29135b2;hb=dc2aa39d20b60e7cd8e0ba66ca6c9ed729add008;hpb=54b63529caa0c113da1bee150e574f9857499326 diff --git a/src/core/core.cpp b/src/core/core.cpp index 9c92faf1..aa1b7d48 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -18,8 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include -#include #include #include "core.h" @@ -53,7 +51,7 @@ void Core::destroy() { Core::Core() : storage(0) { _startTime = QDateTime::currentDateTime().toUTC(); // for uptime :) - loadTranslation(QLocale::system()); + 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 @@ -71,8 +69,7 @@ Core::Core() : storage(0) { 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..."; + if(newSettings.value("Config/Version").toUInt() == 0) { # ifdef Q_WS_MAC QString org = "quassel-irc.org"; # else @@ -80,10 +77,11 @@ Core::Core() : storage(0) { # endif QSettings oldSettings(org, "Quassel Core"); if(oldSettings.allKeys().count()) { + qWarning() << "\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); - qWarning() << "* Your core settings have been migrated to" << newFilePath; + qWarning() << "* Your core settings have been migrated to" << newSettings.fileName(); #ifndef Q_WS_MAC /* we don't need to move the db and cert for mac */ #ifdef Q_OS_WIN32 @@ -116,12 +114,20 @@ Core::Core() : storage(0) { else qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath(); } +#endif /* !Q_WS_MAC */ qWarning() << "*** Migration completed.\n\n"; } } -#endif /* !Q_WS_MAC */ // MIGRATION end + // check settings version + // so far, we only have 1 + CoreSettings s; + if(s.version() != 1) { + qCritical() << "Invalid core settings version, terminating!"; + exit(EXIT_FAILURE); + } + // Register storage backends here! registerStorageBackend(new SqliteStorage(this));