X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=7068f84ec28b67bf30bff7a7437fbde5acd3194f;hp=2b158ab4b27e1bef10557a37b854ce920b13a44f;hb=8166d1701686588630cae9b44310790d084f8fd7;hpb=9d54503555534a2c554f09a33df6afa33d6308ec diff --git a/src/core/core.cpp b/src/core/core.cpp index 2b158ab4..7068f84e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -32,16 +32,14 @@ #include "sqlitestorage.h" #include "util.h" -#include "protocols/legacy/legacypeer.h" - // migration related #include -#ifdef Q_OS_WIN32 +#ifdef Q_OS_WIN # include #else # include # include -#endif /* Q_OS_WIN32 */ +#endif /* Q_OS_WIN */ #ifdef HAVE_UMASK # include @@ -96,11 +94,11 @@ Core::Core() // 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; @@ -108,10 +106,10 @@ Core::Core() 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"; @@ -124,10 +122,10 @@ Core::Core() 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/"; @@ -155,7 +153,7 @@ Core::Core() 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"; } } @@ -382,13 +380,10 @@ bool Core::initStorage(const QString &backend, const QVariantMap &settings, bool 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); @@ -937,7 +932,7 @@ QVariantMap Core::promptForSettings(const Storage *storage) } -#ifdef Q_OS_WIN32 +#ifdef Q_OS_WIN void Core::stdInEcho(bool on) { HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE); @@ -964,4 +959,4 @@ void Core::stdInEcho(bool on) } -#endif /* Q_OS_WIN32 */ +#endif /* Q_OS_WIN */