From 36e3e5ee782b7d4031017da0c315ca533d7b7af4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 28 Apr 2006 23:15:43 +0000 Subject: Memorize the directory that was last visited with the browser across ScummVM runs (see also FR #1460734) svn-id: r22197 --- gui/browser.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gui/browser.cpp') diff --git a/gui/browser.cpp b/gui/browser.cpp index 5876124c47..9a334adf46 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -26,6 +26,7 @@ #include "backends/fs/fs.h" +#include "common/config-manager.h" #include "common/system.h" #include "common/func.h" @@ -156,11 +157,10 @@ BrowserDialog::BrowserDialog(const char *title, bool dirBrowser) } void BrowserDialog::open() { - // If no node has been set, or the last used one is now invalid, - // go back to the root/default dir. - if (!_node.isValid()) { + if (ConfMan.hasKey("browser_lastpath")) + _node = FilesystemNode(ConfMan.get("browser_lastpath")); + if (!_node.isValid()) _node = FilesystemNode(); - } // Alway refresh file list updateListing(); @@ -220,6 +220,9 @@ void BrowserDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data void BrowserDialog::updateListing() { // Update the path display _currentPath->setLabel(_node.path()); + + // We memorize the last visited path. + ConfMan.set("browser_lastpath", _node.path()); // Read in the data from the file system if (_isDirBrowser) -- cgit v1.2.3