Limit variable scope.
Issue found by cppcheck.
This commit is contained in:
parent
3f2b9101b0
commit
f3151c6a48
1 changed files with 1 additions and 2 deletions
|
@ -1264,13 +1264,12 @@ void show_preferences_dialog(display& disp, const config& game_cfg)
|
|||
|
||||
bool show_theme_dialog(display& disp)
|
||||
{
|
||||
int action = 0;
|
||||
std::vector<std::string> options = disp.get_theme().get_known_themes();
|
||||
if(!options.empty()){
|
||||
gui2::tsimple_item_selector dlg(_("Choose theme"), _("Saved preference:") + (" " + preferences::theme()), options);
|
||||
|
||||
dlg.show(disp.video());
|
||||
action = dlg.selected_index();
|
||||
const int action = dlg.selected_index();
|
||||
|
||||
if(action >= 0){
|
||||
preferences::set_theme(options[action]);
|
||||
|
|
Loading…
Add table
Reference in a new issue