aboutsummaryrefslogtreecommitdiff
path: root/gui/browser.cpp
diff options
context:
space:
mode:
authorMax Horn2006-04-28 23:15:43 +0000
committerMax Horn2006-04-28 23:15:43 +0000
commit36e3e5ee782b7d4031017da0c315ca533d7b7af4 (patch)
tree655574f5aabb1e5b1df342eb1a88aa1cdb1fce68 /gui/browser.cpp
parentc1572b2dbd5950774415a7b4db30d7473deeb552 (diff)
downloadscummvm-rg350-36e3e5ee782b7d4031017da0c315ca533d7b7af4.tar.gz
scummvm-rg350-36e3e5ee782b7d4031017da0c315ca533d7b7af4.tar.bz2
scummvm-rg350-36e3e5ee782b7d4031017da0c315ca533d7b7af4.zip
Memorize the directory that was last visited with the browser across ScummVM runs (see also FR #1460734)
svn-id: r22197
Diffstat (limited to 'gui/browser.cpp')
-rw-r--r--gui/browser.cpp11
1 files changed, 7 insertions, 4 deletions
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)