diff options
author | Bastien Bouclet | 2016-08-29 08:03:40 +0200 |
---|---|---|
committer | Bastien Bouclet | 2016-08-30 21:19:59 +0200 |
commit | dac70196f08650dc90837a7d4d68b7e9d115345d (patch) | |
tree | 37fd17da0306574888926db6c32ccd1b6beb2612 | |
parent | 8d6a6fb982d3eced17081c6bf7dfe34ace23e4f7 (diff) | |
download | scummvm-rg350-dac70196f08650dc90837a7d4d68b7e9d115345d.tar.gz scummvm-rg350-dac70196f08650dc90837a7d4d68b7e9d115345d.tar.bz2 scummvm-rg350-dac70196f08650dc90837a7d4d68b7e9d115345d.zip |
GUI: Fix hidden files visibility getting out of sync in the files browser
- The checkbox state was not initialized when opening the dialog.
- The visibility state was initialized from ConfMan too early resuling
in the value being incorrect when multiple file browsers are used.
-rw-r--r-- | gui/browser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp index 83e240a5bc..19fa791cee 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -49,7 +49,7 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) _isDirBrowser = dirBrowser; _fileList = NULL; _currentPath = NULL; - _showHidden = ConfMan.getBool("gui_browser_show_hidden", Common::ConfigManager::kApplicationDomain); + _showHidden = false; // Headline - TODO: should be customizable during creation time new StaticTextWidget(this, "Browser.Headline", title); @@ -85,8 +85,10 @@ void BrowserDialog::open() { if (!_node.isDirectory()) _node = Common::FSNode("."); - // Alway refresh file list - updateListing(); + _showHidden = ConfMan.getBool("gui_browser_show_hidden", Common::ConfigManager::kApplicationDomain); + _showHiddenWidget->setState(_showHidden); + + // At this point the file list has already been refreshed by the kHiddenCmd handler } void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { |