qmlFrontend/hwengine.cpp
branchqmlfrontend
changeset 10616 20a2d5e6930a
parent 10612 eb3c1a289a23
child 10819 57e21f7621b0
--- a/qmlFrontend/hwengine.cpp	Sun Dec 07 22:22:39 2014 +0300
+++ b/qmlFrontend/hwengine.cpp	Thu Dec 18 00:03:53 2014 +0300
@@ -25,6 +25,7 @@
     freeThemesList_t *flibFreeThemesList;
     getThemeIcon_t *flibGetThemeIcon;
     getScriptsList_t *flibGetScriptsList;
+    getSchemesList_t *flibGetSchemesList;
     getTeamsList_t *flibGetTeamsList;
     tryAddTeam_t * flibTryAddTeam;
     tryRemoveTeam_t * flibTryRemoveTeam;
@@ -62,6 +63,7 @@
     flibGetThemeIcon = (getThemeIcon_t*) hwlib.resolve("getThemeIcon");
 
     flibGetScriptsList = (getScriptsList_t*) hwlib.resolve("getScriptsList");
+    flibGetSchemesList = (getSchemesList_t*) hwlib.resolve("getSchemesList");
 
     flibResetGameConfig = (resetGameConfig_t*) hwlib.resolve("resetGameConfig");
     flibGetTeamsList = (getTeamsList_t*) hwlib.resolve("getTeamsList");
@@ -171,25 +173,25 @@
     QStringList resultModel;
 
     char ** themes = flibGetThemesList();
-    for (char **i = themes; *i != NULL; i++) {
-        QString theme = QString::fromUtf8(*i);
-
-        resultModel << theme;
-    }
+    for (char **i = themes; *i != NULL; i++)
+        resultModel << QString::fromUtf8(*i);
     flibFreeThemesList(themes);
 
     m_engine->rootContext()->setContextProperty("themesModel", QVariant::fromValue(resultModel));
 
+    // scripts model
     resultModel.clear();
-    char ** scripts = flibGetScriptsList();
-
-    for (char **i = scripts; *i != NULL; i++) {
-        QString script = QString::fromUtf8(*i);
-
-        resultModel << script;
-    }
+    for (char **i = flibGetScriptsList(); *i != NULL; i++)
+        resultModel << QString::fromUtf8(*i);
 
     m_engine->rootContext()->setContextProperty("scriptsModel", QVariant::fromValue(resultModel));
+
+    // schemes model
+    resultModel.clear();
+    for (char **i = flibGetSchemesList(); *i != NULL; i++)
+        resultModel << QString::fromUtf8(*i);
+
+    m_engine->rootContext()->setContextProperty("schemesModel", QVariant::fromValue(resultModel));
 }
 
 void HWEngine::getTeamsList()