From 20638a0f97438fff10cb8ac1bf90c197e032faa2 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Sat, 10 Jan 2009 23:38:30 +0000 Subject: Moved some stuff from the EditGameDialog constructor to its open() method to avoid uninitialised variables. (This is similar to some bugs that were fixed earlier today.) svn-id: r35811 --- gui/launcher.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 3753f67aeb..119e3596f8 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -246,16 +246,10 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) // GUI: Button + Label for the additional path new ButtonWidget(tab, "GameOptions_Paths.Extrapath", "Extra Path:", kCmdExtraBrowser, 0); _extraPathWidget = new StaticTextWidget(tab, "GameOptions_Paths.ExtrapathText", extraPath); - if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { - _extraPathWidget->setLabel("None"); - } // GUI: Button + Label for the save path new ButtonWidget(tab, "GameOptions_Paths.Savepath", "Save Path:", kCmdSaveBrowser, 0); _savePathWidget = new StaticTextWidget(tab, "GameOptions_Paths.SavepathText", savePath); - if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { - _savePathWidget->setLabel("Default"); - } // Activate the first tab tab->setActiveTab(0); @@ -280,6 +274,16 @@ void EditGameDialog::reflowLayout() { void EditGameDialog::open() { OptionsDialog::open(); + String extraPath(ConfMan.get("extrapath", _domain)); + if (extraPath.empty() || !ConfMan.hasKey("extrapath", _domain)) { + _extraPathWidget->setLabel("None"); + } + + String savePath(ConfMan.get("savepath", _domain)); + if (savePath.empty() || !ConfMan.hasKey("savepath", _domain)) { + _savePathWidget->setLabel("Default"); + } + int sel, i; bool e; -- cgit v1.2.3