qmlFrontend/hwengine.cpp
branchqmlfrontend
changeset 10442 c58db813240b
parent 10436 084e046f6bd5
child 10444 47a6231f1fc1
--- a/qmlFrontend/hwengine.cpp	Mon Oct 13 23:46:49 2014 +0400
+++ b/qmlFrontend/hwengine.cpp	Mon Oct 20 22:55:12 2014 +0400
@@ -20,6 +20,7 @@
     getThemesList_t *flibGetThemesList;
     freeThemesList_t *flibFreeThemesList;
     getThemeIcon_t *flibGetThemeIcon;
+    getTeamsList_t *flibGetTeamsList;
 }
 
 Q_DECLARE_METATYPE(MessageType);
@@ -48,6 +49,8 @@
     flibFreeThemesList = (freeThemesList_t*) hwlib.resolve("freeThemesList");
     flibGetThemeIcon = (getThemeIcon_t*) hwlib.resolve("getThemeIcon");
 
+    flibGetTeamsList = (getTeamsList_t*) hwlib.resolve("getTeamsList");
+
     flibInit("/usr/home/unC0Rr/Sources/Hedgewars/Hedgewars-GC/share/hedgewars/Data", "/usr/home/unC0Rr/.hedgewars");
     flibRegisterGUIMessagesCallback(this, &guiMessagesCallback);
 
@@ -130,3 +133,13 @@
 
     m_engine->rootContext()->setContextProperty("themesModel", QVariant::fromValue(resultModel));
 }
+
+void HWEngine::getTeamsList()
+{
+    char ** teams = flibGetTeamsList();
+    for (char **i = teams; *i != NULL; i++) {
+        QString team = QString::fromUtf8(*i);
+
+        emit localTeamAdded(team, 0);
+    }
+}