/***************************************************************************
- * Copyright (C) 2005-2014 by the Quassel Project *
+ * Copyright (C) 2005-2015 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
#include "sqlitestorage.h"
#include "util.h"
-#include "protocols/legacy/legacypeer.h"
-
// migration related
#include <QFile>
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
# include <windows.h>
#else
# include <unistd.h>
# include <termios.h>
-#endif /* Q_OS_WIN32 */
+#endif /* Q_OS_WIN */
#ifdef HAVE_UMASK
# include <sys/types.h>
// 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_MAC
+#ifdef Q_OS_MAC
QSettings newSettings("quassel-irc.org", "quasselcore");
#else
-# ifdef Q_WS_WIN
+# ifdef Q_OS_WIN
QSettings::Format format = QSettings::IniFormat;
# else
QSettings::Format format = QSettings::NativeFormat;
QString newFilePath = Quassel::configDirPath() + "quasselcore"
+ ((format == QSettings::NativeFormat) ? QLatin1String(".conf") : QLatin1String(".ini"));
QSettings newSettings(newFilePath, format);
-#endif /* Q_WS_MAC */
+#endif /* Q_OS_MAC */
if (newSettings.value("Config/Version").toUInt() == 0) {
-# ifdef Q_WS_MAC
+# ifdef Q_OS_MAC
QString org = "quassel-irc.org";
# else
QString org = "Quassel Project";
newSettings.setValue("Config/Version", 1);
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
+#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_WS_MAC
+#elif defined Q_OS_MAC
QString quasselDir = QDir::homePath() + "/Library/Application Support/Quassel/";
#else
QString quasselDir = QDir::homePath() + "/.quassel/";
else
qWarning() << "!!! Moving your certificate has failed. Please move it manually into" << Quassel::configDirPath();
}
-#endif /* !Q_WS_MAC */
+#endif /* !Q_OS_MAC */
qWarning() << "*** Migration completed.\n\n";
}
}
return false; // trigger setup process
if (storage->setup(settings))
return initStorage(backend, settings, false);
- // if setup wasn't successfull we mark the backend as unavailable
+ // if initialization wasn't successful, we quit to keep from coming up unconfigured
case Storage::NotAvailable:
- qCritical() << "Selected storage backend is not available:" << backend;
- storage->deleteLater();
- _storageBackends.remove(backend);
- storage = 0;
- return false;
+ qCritical() << "FATAL: Selected storage backend is not available:" << backend;
+ exit(EXIT_FAILURE);
case Storage::IsReady:
// delete all other backends
_storageBackends.remove(backend);
}
-#ifdef Q_OS_WIN32
+#ifdef Q_OS_WIN
void Core::stdInEcho(bool on)
{
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
}
-#endif /* Q_OS_WIN32 */
+#endif /* Q_OS_WIN */