From 5bfce457678b31f30929f6b2955ef120853844fd 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: Sun, 8 Aug 2021 07:53:58 +0200 Subject: [PATCH] check if db is writable before using it clearer error messages --- core/src/db_manager.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/db_manager.cpp b/core/src/db_manager.cpp index d8e2ace..d295749 100644 --- a/core/src/db_manager.cpp +++ b/core/src/db_manager.cpp @@ -20,6 +20,9 @@ DBManager::DBManager() : DRIVER("QSQLITE") { + if(!access("config/akashi.db", R_OK | W_OK)) + qCritical() << "Database Error: Missing permissions. Check if \"" + "config/akashi.db" "\" is writable.\n"; + db = QSqlDatabase::addDatabase(DRIVER); db.setDatabaseName("config/akashi.db"); if (!db.open())