Commit 20a270e4 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer

Create the path of the settings database if it doesn't exist yet

Otherwise creation of the database fails on the first startup...
parent f5e7fb9c
......@@ -29,6 +29,7 @@
#include "settingsdatabase.h"
#include <QtCore/QDir>
#include <QtCore/QMap>
#include <QtSql/QSqlDatabase>
#include <QtSql/QSqlError>
......@@ -94,6 +95,10 @@ SettingsDatabase::SettingsDatabase(const QString &path,
const QLatin1Char slash('/');
// TODO: Don't rely on a path, but determine automatically
QDir pathDir(path);
if (!pathDir.exists())
pathDir.mkpath(pathDir.absolutePath());
QString fileName = path;
if (!fileName.endsWith(slash))
fileName += slash;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment