Co-authored-by: oldmud0 <oldmud0@users.noreply.github.com>
This commit is contained in:
t-h-i-s-u-s-e-r-n-a-m-e-i-s-c-a-n-c-e-r 2021-08-09 17:56:59 +02:00 committed by GitHub
parent a624fd502a
commit fd250ee13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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