Skip to content

Commit

Permalink
Shell: Config variable type issue
Browse files Browse the repository at this point in the history
"Config.LocalServer.gameMode" is expected to be an integer (index in the
list of known games).
  • Loading branch information
skyjake committed Sep 12, 2019
1 parent 2970ddb commit e650224
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions doomsday/tools/shell/src/localserverdialog.cpp
Expand Up @@ -71,8 +71,12 @@ DE_GUI_PIMPL(LocalServerDialog)
{
games->items() << new ChoiceItem(mode.title, TextValue(mode.option));
}
games->setSelected(
games->items().findData(TextValue(cfg.gets("LocalServer.gameMode", "doom1-share"))));
/*auto sel = games->items().findData(TextValue(cfg.gets("LocalServer.gameMode", "doom1-share")));
if (sel == ui::Data::InvalidPos)
{
sel = games->items().findData(TextValue("doom1-share"));
}*/
games->setSelected(cfg.getui("LocalServer.gameMode", 0));
layout << *LabelWidget::newWithText("Game Mode:", &area)
<< *games;

Expand Down Expand Up @@ -269,7 +273,7 @@ void LocalServerDialog::saveState()
auto &cfg = Config::get();

cfg.set("LocalServer.name", d->name->text());
cfg.set("LocalServer.gameMode", d->games->selectedItem().data().asText());
cfg.set("LocalServer.gameMode", int(d->games->selected())); //Item().data().asText());
if (d->portChanged)
{
cfg.set("LocalServer.port", d->port->text().toInt());
Expand Down

0 comments on commit e650224

Please sign in to comment.