From d54819e15bff7b09a57e75de274eabe67ffd5672 Mon Sep 17 00:00:00 2001 From: Christian Hohnstaedt Date: Fri, 7 May 2021 12:30:36 +0200 Subject: [PATCH] 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. --- lib/database_model.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database_model.cpp b/lib/database_model.cpp index 2f990544..c1402008 100644 --- a/lib/database_model.cpp +++ b/lib/database_model.cpp @@ -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);