database_model: better handle uncreateable databases

Current implementation did not check whether a non-existing
database-file could be created.

Throw an error message if the database file cannot be created.
Simply by using XFile instead of QFile.
This commit is contained in:
Christian Hohnstaedt 2021-05-07 12:30:36 +02:00
parent 0232d20b2b
commit d54819e15b

View File

@ -542,7 +542,7 @@ void database_model::openLocalDatabase(const QString &connName,
const QString &descriptor)
{
QSqlDatabase db = QSqlDatabase::database(connName);
QFile f(descriptor);
XFile f(descriptor);
qDebug() << connName << descriptor;
if (!f.exists(descriptor)) {
f.open(QIODevice::WriteOnly);