/***************************************************************************
- * Copyright (C) 2005-2013 by the Quassel Project *
+ * Copyright (C) 2005-2014 by the Quassel Project *
* devel@quassel-irc.org *
* *
* This program is free software; you can redistribute it and/or modify *
}
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();
+ }
}
}