QTfrontend/util/DataManager.cpp
changeset 7258 722e8a0d89dc
parent 6959 fce378ee4191
child 7260 c3584a3ab730
--- a/QTfrontend/util/DataManager.cpp	Sun Jun 17 16:32:44 2012 +0200
+++ b/QTfrontend/util/DataManager.cpp	Sun Jun 17 21:45:49 2012 +0400
@@ -23,13 +23,17 @@
 
 #include <QMap>
 #include <QStringList>
-
+#include <QStandardItemModel>
 #include <QFileInfo>
 
 #include "hwconsts.h"
 
 #include "DataManager.h"
 
+#include "GameStyleModel.h"
+#include "HatModel.h"
+#include "MapModel.h"
+#include "ThemeModel.h"
 
 DataManager::DataManager()
 {
@@ -42,6 +46,7 @@
     m_hatModel = NULL;
     m_mapModel = NULL;
     m_themeModel = NULL;
+    m_colorsModel = NULL;
 }
 
 
@@ -154,6 +159,25 @@
     return m_themeModel;
 }
 
+QStandardItemModel * DataManager::colorsModel()
+{
+    if(m_colorsModel == NULL)
+    {
+        m_colorsModel = new QStandardItemModel();
+
+        int i = 0;
+        while(colors[i])
+        {
+            QStandardItem * item = new QStandardItem();
+            item->setData(QColor(colors[i]));
+            m_colorsModel->appendRow(item);
+            ++i;
+        }
+    }
+
+    return m_colorsModel;
+}
+
 void DataManager::reload()
 {
     m_gameStyleModel->loadGameStyles();