QTfrontend/model/hats.cpp
changeset 6196 c16e84558f71
parent 6167 728cabee2c9f
child 6616 f77bb02b669f
--- a/QTfrontend/model/hats.cpp	Mon Oct 24 06:10:28 2011 +0200
+++ b/QTfrontend/model/hats.cpp	Mon Oct 24 06:54:46 2011 +0200
@@ -28,12 +28,14 @@
 HatsModel::HatsModel(QObject* parent) :
   QAbstractListModel(parent)
 {
+    HWDataManager & dataMgr = HWDataManager::instance();
+
     QPixmap hhpix = QPixmap(
-        HWDataManager::instance().findFileForRead("Graphics/Hedgehog/Idle.png")
+        dataMgr.findFileForRead("Graphics/Hedgehog/Idle.png")
     ).copy(0, 0, 32, 32);
 
     // my reserved hats
-    QStringList hatsList = HWDataManager::instance().entryList(
+    QStringList hatsList = dataMgr.entryList(
                                    "Graphics/Hats/Reserved",
                                    QDir::Files,
                                    QStringList(playerHash+"*.png")
@@ -42,7 +44,7 @@
     int nReserved = hatsList.size();
 
     // regular hats
-    hatsList.append(HWDataManager::instance().entryList(
+    hatsList.append(dataMgr.entryList(
                                    "Graphics/Hats",
                                    QDir::Files,
                                    QStringList("*.png")
@@ -59,7 +61,7 @@
         QString str = hatsList.at(i);
         str = str.remove(QRegExp("\\.png$"));
         QPixmap pix(
-            HWDataManager::instance().findFileForRead(
+            dataMgr.findFileForRead(
                 "Graphics/Hats/" + QString(isReserved?"Reserved/":"") + str + 
                 ".png"
             )