diff options
author | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-06-12 14:51:01 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com> | 2009-06-12 15:45:35 +0200 |
commit | 20a270e4ae2f28ee7616c88850f96076817597af (patch) | |
tree | ae0e14b63af52ef5c6449ad0fdb80fcd09166025 | |
parent | f5e7fb9cbb7f3faa573bebc3b8016db93ccec1fd (diff) |
Create the path of the settings database if it doesn't exist yet
Otherwise creation of the database fails on the first startup...
-rw-r--r-- | src/plugins/coreplugin/settingsdatabase.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/coreplugin/settingsdatabase.cpp b/src/plugins/coreplugin/settingsdatabase.cpp index 00958a7a67..5987b3c582 100644 --- a/src/plugins/coreplugin/settingsdatabase.cpp +++ b/src/plugins/coreplugin/settingsdatabase.cpp @@ -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; |