From: Manuel Nickschas Date: Fri, 6 Apr 2018 16:43:26 +0000 (+0200) Subject: Don't terminate the core due to backend issues while setting up X-Git-Tag: 0.12.5~9 X-Git-Url: https://git.quassel-irc.org/?a=commitdiff_plain;h=e382ef52444fc267c2ecfe196359a79e858aa721;p=quassel.git Don't terminate the core due to backend issues while setting up If the storage backend selected by the user during core setup cannot be initialized, the problem shall be communicated to the client and the user can start over; the core shall not exit in this case. Ensure that failure to initialize the selected backend only terminates the core if it's not being setup. --- diff --git a/src/core/core.cpp b/src/core/core.cpp index 450bc04c..0cf3b1e9 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -381,10 +381,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 _storageBackends.remove(backend);