From fd250ee13d39a3d16bf673749de24be453edee86 Mon Sep 17 00:00:00 2001 From: t-h-i-s-u-s-e-r-n-a-m-e-i-s-c-a-n-c-e-r <88607531+t-h-i-s-u-s-e-r-n-a-m-e-i-s-c-a-n-c-e-r@users.noreply.github.com> Date: Mon, 9 Aug 2021 17:56:59 +0200 Subject: [PATCH] thanks Co-authored-by: oldmud0 --- core/src/db_manager.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/core/src/db_manager.cpp b/core/src/db_manager.cpp index 7acb899..7de8104 100644 --- a/core/src/db_manager.cpp +++ b/core/src/db_manager.cpp @@ -20,12 +20,10 @@ DBManager::DBManager() : DRIVER("QSQLITE") { - QFileInfo *db_info = new QFileInfo; - *db_info = QFileInfo("config/akashi.db"); - if(!(db_info->isReadable()) || !(db_info->isWritable())) - qCritical() << "Database Error: Missing permissions. Check if \"config/akashi.db\" is writable.\n"; - delete db_info; - + const QString db_filename = "config/akashi.db"; + QFileInfo db_info(db_filename); + if(!db_info.isReadable() || !db_info.isWritable()) + qCritical() << tr("Database Error: Missing permissions. Check if \"%1\" is writable.").arg(db_filename); db = QSqlDatabase::addDatabase(DRIVER); db.setDatabaseName("config/akashi.db");