QTfrontend/util/namegen.cpp
changeset 6167 728cabee2c9f
parent 6160 863d3edf5690
child 6212 a5d95f32e17f
--- a/QTfrontend/util/namegen.cpp	Fri Oct 21 08:03:42 2011 +0200
+++ b/QTfrontend/util/namegen.cpp	Fri Oct 21 08:41:21 2011 +0200
@@ -125,8 +125,8 @@
     QStringList list;
 
     // find .txt to load the names from
-    QFile * file = HWDataManager::instance().findFileForRead(QString(
-                                                "Names/%1.txt").arg(filename));
+    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
+                                                "Names/%1.txt").arg(filename)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
     {
@@ -154,8 +154,8 @@
     QStringList list;
 
     // find .cfg to load the dicts from
-    QFile * file = HWDataManager::instance().findFileForRead(QString(
-                                                "Names/%1.cfg").arg(hatname));
+    QFile * file = new QFile(HWDataManager::instance().findFileForRead(QString(
+                                                "Names/%1.cfg").arg(hatname)));
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))
     {
@@ -183,8 +183,8 @@
     typesAvailable = false;
 
     // find .ini to load the names from
-    QFile * file =
-          HWDataManager::instance().findFileForRead(QString("Names/types.ini"));
+    QFile * file = new QFile(
+        HWDataManager::instance().findFileForRead(QString("Names/types.ini")));
 
 
     if (file->exists() && file->open(QIODevice::ReadOnly | QIODevice::Text))