# HG changeset patch # User sheepluva # Date 1319447649 -7200 # Node ID 582e85254110f41d1631768a4a6769faab4b7f54 # Parent 9aa9ed77d63cd0cfba732947c5463deeb04640b4 on file save: create parent directories if needed diff -r 9aa9ed77d63c -r 582e85254110 QTfrontend/util/HWDataManager.cpp --- 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 #include +#include + #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 "";