diff --git a/core/include/db_manager.h b/core/include/db_manager.h index fcc5f4a..2e26f95 100644 --- a/core/include/db_manager.h +++ b/core/include/db_manager.h @@ -29,6 +29,7 @@ #include #include #include +#include /** * @brief A class used to handle database interaction. diff --git a/core/src/db_manager.cpp b/core/src/db_manager.cpp index d8e2ace..7de8104 100644 --- a/core/src/db_manager.cpp +++ b/core/src/db_manager.cpp @@ -20,6 +20,11 @@ DBManager::DBManager() : DRIVER("QSQLITE") { + 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"); if (!db.open())