Quick Game: ignore hidden themes
authorsheepluva
Sat, 07 Apr 2018 23:38:19 +0200
changeset 13313 93780a3b846a
parent 13312 092adcf707c5
child 13314 fe85ba81b01b
Quick Game: ignore hidden themes
QTfrontend/game.cpp
--- a/QTfrontend/game.cpp	Sat Apr 07 22:16:36 2018 +0200
+++ b/QTfrontend/game.cpp	Sat Apr 07 23:38:19 2018 +0200
@@ -140,11 +140,11 @@
 void HWGame::SendQuickConfig()
 {
     QByteArray teamscfg;
-    ThemeModel * themeModel = DataManager::instance().themeModel();
+    QAbstractItemModel * themeModel = DataManager::instance().themeModel()->withoutHidden();
 
     HWProto::addStringToBuffer(teamscfg, "TL");
     HWProto::addStringToBuffer(teamscfg, QString("etheme %1")
-                               .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount()).data(ThemeModel::ActualNameRole).toString() : "Nature"));
+                               .arg((themeModel->rowCount() > 0) ? themeModel->index(rand() % themeModel->rowCount(), 0).data(ThemeModel::ActualNameRole).toString() : "Nature"));
     HWProto::addStringToBuffer(teamscfg, "eseed " + QUuid::createUuid().toString());
 
     HWProto::addStringToBuffer(teamscfg, "e$template_filter 2");