X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.cpp;h=cb0745478d756d3bc3247457a1380c5559043644;hp=e721e4d93a6b6792291e1b0c421e2d32b0febdc7;hb=921e54680da16fcf2adb7a90506875aceb6633a4;hpb=5b686746c880e5cda6d5de3e08180ea4332ff222 diff --git a/src/core/abstractsqlstorage.cpp b/src/core/abstractsqlstorage.cpp index e721e4d9..cb074547 100644 --- a/src/core/abstractsqlstorage.cpp +++ b/src/core/abstractsqlstorage.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2012 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 * @@ -91,11 +91,14 @@ void AbstractSqlStorage::addConnectionToPool() } if (!db.open()) { - qWarning() << "Unable to open database" << displayName() << "for thread" << QThread::currentThread(); - qWarning() << "-" << db.lastError().text(); + quWarning() << "Unable to open database" << displayName() << "for thread" << QThread::currentThread(); + quWarning() << "-" << db.lastError().text(); } else { - initDbSession(db); + if (!initDbSession(db)) { + quWarning() << "Unable to initialize database" << displayName() << "for thread" << QThread::currentThread(); + db.close(); + } } } @@ -406,7 +409,7 @@ void AbstractSqlMigrator::dumpStatus() qWarning() << " bound Values:"; QList list = boundValues(); for (int i = 0; i < list.size(); ++i) - qWarning() << i << ": " << list.at(i).toString().toAscii().data(); + qWarning() << i << ": " << list.at(i).toString().toLatin1().data(); qWarning() << " Error Number:" << lastError().number(); qWarning() << " Error Message:" << lastError().text(); }