#include "client.h"
#include "cliparser.h"
#include "qtui.h"
+#include "qtuisettings.h"
#include "sessionsettings.h"
QtUiApplication::QtUiApplication(int &argc, char **argv)
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 client settings...";
+ if(newSettings.value("Config/Version").toUInt() == 0) {
# ifdef Q_WS_MAC
QString org = "quassel-irc.org";
# else
# 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" << newFilePath;
+ qWarning() << "* Your client settings have been migrated to" << newSettings.fileName();
+ qWarning() << "*** Migration completed.\n\n";
}
- qWarning() << "*** Migration completed.\n\n";
}
// MIGRATION end
+ // check settings version
+ // so far, we only have 1
+ QtUiSettings s;
+ if(s.version() != 1) {
+ qCritical() << "Invalid client settings version, terminating!";
+ return false;
+ }
+
// session resume
QtUi *gui = new QtUi();
Client::init(gui);