Check DB is valid too

This commit is contained in:
Craig Drummond
2016-07-12 20:20:50 +01:00
parent 77b0df9677
commit a82180f963

View File

@@ -532,7 +532,7 @@ bool LibraryDb::init(const QString &dbFile)
DBUG << dbFile << dbName;
currentVersion=0;
db=new QSqlDatabase(QSqlDatabase::addDatabase("QSQLITE", dbName.isEmpty() ? QLatin1String(QSqlDatabase::defaultConnection) : dbName));
if (!db) {
if (!db || !db->isValid()) {
MessageBox::error(qApp->activeWindow(), i18n("Failed to load SQLite database!\n\n"
"Please check you have the Qt SQLite database driver instaled.\n\n"
"Cantata will now terminate."));