diff --git a/core/src/db_manager.cpp b/core/src/db_manager.cpp index 8666596..0fd3a4d 100644 --- a/core/src/db_manager.cpp +++ b/core/src/db_manager.cpp @@ -22,8 +22,14 @@ DBManager::DBManager() : { 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); + if (!db_info.exists()) { + qWarning().noquote() << tr("Database Info: Database not found. Attempting to create new database."); + } + else { + //We should only check if a file is readable/writeable when it actually exists. + 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");