X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fabstractsqlstorage.cpp;h=cb0745478d756d3bc3247457a1380c5559043644;hp=ad08947d9120b6b1a3a2038566fa560a28cbe7b1;hb=e50ae7a06fc4e5d3a911c361d30953410deab609;hpb=9fc57dc2c000e80fb8bd746a090e2e8210e1278e diff --git a/src/core/abstractsqlstorage.cpp b/src/core/abstractsqlstorage.cpp index ad08947d..cb074547 100644 --- a/src/core/abstractsqlstorage.cpp +++ b/src/core/abstractsqlstorage.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2013 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(); }