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");