QTfrontend/util/HWDataManager.cpp
changeset 6199 582e85254110
parent 6196 c16e84558f71
child 6616 f77bb02b669f
--- a/QTfrontend/util/HWDataManager.cpp	Mon Oct 24 10:59:52 2011 +0200
+++ b/QTfrontend/util/HWDataManager.cpp	Mon Oct 24 11:14:09 2011 +0200
@@ -25,6 +25,8 @@
 #include <QMap>
 #include <QStringList>
 
+#include <QFileInfo>
+
 #include "hwconsts.h"
 
 #include "HWDataManager.h"
@@ -99,7 +101,15 @@
                                 const QString & relativeDataFilePath) const
 {
     if (userData != NULL)
-        return userData->absolutePath()+"/"+relativeDataFilePath;
+    {
+        QString path = userData->absolutePath()+"/"+relativeDataFilePath;
+
+        // create folders if needed
+        QDir tmp;
+        tmp.mkpath(QFileInfo(path).absolutePath());
+
+        return path;
+    }
 
 
     return "";