X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.cpp;h=149aabb147eb72cd1f7114dfec8fc331d809b726;hp=fce1bb1d17fc69df980aae3faa897972dbcc9420;hb=ddfb1d2574c4bffd180361a80df9b1cd584bb040;hpb=f10304a35af0a7a4f8b812e467e69287d358ce7c diff --git a/src/core/abstractsqlstorage.cpp b/src/core/abstractsqlstorage.cpp index fce1bb1d..149aabb1 100644 --- a/src/core/abstractsqlstorage.cpp +++ b/src/core/abstractsqlstorage.cpp @@ -19,9 +19,6 @@ ***************************************************************************/ #include "abstractsqlstorage.h" -#include "quassel.h" - -#include "logger.h" #include #include @@ -29,6 +26,9 @@ #include #include +#include "logmessage.h" +#include "quassel.h" + int AbstractSqlStorage::_nextConnectionId = 0; AbstractSqlStorage::AbstractSqlStorage(QObject *parent) : Storage(parent), @@ -139,20 +139,19 @@ Storage::State AbstractSqlStorage::init(const QVariantMap &settings, } if (installedSchemaVersion() < schemaVersion()) { - qWarning() << qPrintable(tr("Installed Schema (version %1) is not up to date. Upgrading to " - "version %2... This may take a while for major upgrades." - ).arg(installedSchemaVersion()).arg(schemaVersion())); - // TODO: The monolithic client won't show this message unless one looks into the debug log. - // This should be made more friendly, e.g. a popup message in the GUI. - if (!upgradeDb()) { + quInfo() << qPrintable(tr("Installed database schema (version %1) is not up to date. Upgrading to " + "version %2... This may take a while for major upgrades." + ).arg(installedSchemaVersion()).arg(schemaVersion())); + emit dbUpgradeInProgress(true); + auto upgradeResult = upgradeDb(); + emit dbUpgradeInProgress(false); + if (!upgradeResult) { qWarning() << qPrintable(tr("Upgrade failed...")); return NotAvailable; } - // Warning messages are also sent to the console, while Info messages aren't. Add a message - // when migration succeeds to avoid confusing folks by implying the schema upgrade failed if + // Add a message when migration succeeds to avoid confusing folks by implying the schema upgrade failed if // later functionality does not work. - qWarning() << qPrintable(tr("Installed Schema successfully upgraded to version %1." - ).arg(schemaVersion())); + quInfo() << qPrintable(tr("Installed database schema successfully upgraded to version %1.").arg(schemaVersion())); } quInfo() << qPrintable(displayName()) << "storage backend is ready. Schema version:" << installedSchemaVersion();