QTfrontend/util/DataManager.cpp
changeset 6953 4c2dd25630a7
parent 6952 7f70f37bbf08
child 6958 8230a516ba93
--- a/QTfrontend/util/DataManager.cpp	Sat Apr 28 18:56:31 2012 +0200
+++ b/QTfrontend/util/DataManager.cpp	Sun Apr 29 14:00:35 2012 +0200
@@ -39,6 +39,7 @@
 
     m_defaultData = new QDir(datadir->absolutePath());
 
+    m_hatModel = NULL;
     m_mapModel = NULL;
     m_themeModel = NULL;
 }
@@ -117,6 +118,15 @@
     return "";
 }
 
+HatModel * DataManager::hatModel()
+{
+    if (m_hatModel == NULL) {
+        m_hatModel = new HatModel();
+        m_hatModel->loadHats();
+    }
+    return m_hatModel;
+}
+
 MapModel * DataManager::mapModel()
 {
     if (m_mapModel == NULL) {
@@ -137,6 +147,7 @@
 
 void DataManager::reload()
 {
+    m_hatModel->loadHats();
     m_mapModel->loadMaps();
     m_themeModel->loadThemes();
     emit updated();