QTfrontend/util/HWDataManager.cpp
changeset 6167 728cabee2c9f
parent 6160 863d3edf5690
child 6168 6f301dac12ff
--- a/QTfrontend/util/HWDataManager.cpp	Fri Oct 21 08:03:42 2011 +0200
+++ b/QTfrontend/util/HWDataManager.cpp	Fri Oct 21 08:41:21 2011 +0200
@@ -75,17 +75,15 @@
 }
 
 
-QFile * HWDataManager::findFileForRead(
+QString HWDataManager::findFileForRead(
                                 const QString & relativeDataFilePath) const
 {
-    QFile * file =
-            new QFile(userData->absolutePath()+"/"+relativeDataFilePath);
-    if (!file->exists())
-    {
-        delete file;
-        file = new QFile(defaultData->absolutePath()+"/"+relativeDataFilePath);
-    }
-    return file;
+    QString path = userData->absolutePath()+"/"+relativeDataFilePath;
+
+    if (!QFile::exists(path))
+        path = defaultData->absolutePath()+"/"+relativeDataFilePath;
+
+    return path;
 }