X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore.cpp;h=691750812189ddd88e2cf418f0ea4ea5b6735912;hb=92f4dca367c3a6f0536a1e0f3fbb44bb6ed4da62;hp=1a418f1d08ddce65ece600e5393c608bacd3cf7d;hpb=cfbd4daee17dbb3c4052d938bf33edd08711d728;p=quassel.git diff --git a/src/core/core.cpp b/src/core/core.cpp index 1a418f1d..69175081 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2016 by the Quassel Project * + * Copyright (C) 2005-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -403,10 +403,15 @@ bool Core::initStorage(const QString &backend, const QVariantMap &settings, bool return false; // trigger setup process if (storage->setup(settings)) return initStorage(backend, settings, false); + return false; + // if initialization wasn't successful, we quit to keep from coming up unconfigured case Storage::NotAvailable: qCritical() << "FATAL: Selected storage backend is not available:" << backend; - exit(EXIT_FAILURE); + if (!setup) + exit(EXIT_FAILURE); + return false; + case Storage::IsReady: // delete all other backends _registeredStorageBackends.clear(); @@ -495,10 +500,15 @@ bool Core::initAuthenticator(const QString &backend, const QVariantMap &settings return false; // trigger setup process if (auth->setup(settings)) return initAuthenticator(backend, settings, false); + return false; + // if initialization wasn't successful, we quit to keep from coming up unconfigured case Authenticator::NotAvailable: qCritical() << "FATAL: Selected auth backend is not available:" << backend; - exit(EXIT_FAILURE); + if (!setup) + exit(EXIT_FAILURE); + return false; + case Authenticator::IsReady: // delete all other backends _registeredAuthenticators.clear(); @@ -862,7 +872,7 @@ bool Core::selectBackend(const QString &backend) qDebug() << qPrintable(tr("Migrating storage backend %1 to %2...").arg(_storage->displayName(), storage->displayName())); _storage.reset(); storage.reset(); - if (reader->migrateTo(writer)) { + if (reader->migrateTo(writer.get())) { qDebug() << "Migration finished!"; qDebug() << qPrintable(tr("Migration finished!")); if (!saveBackendSettings(backend, settings)) {