[Scummvm-cvs-logs] SF.net SVN: scummvm: [22197] scummvm/trunk/gui/browser.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Apr 28 16:16:05 CEST 2006


Revision: 22197
Author:   fingolfin
Date:     2006-04-28 16:15:43 -0700 (Fri, 28 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22197&view=rev

Log Message:
-----------
Memorize the directory that was last visited with the browser across ScummVM runs (see also FR #1460734)

Modified Paths:
--------------
    scummvm/trunk/gui/browser.cpp
Modified: scummvm/trunk/gui/browser.cpp
===================================================================
--- scummvm/trunk/gui/browser.cpp	2006-04-28 00:42:33 UTC (rev 22196)
+++ scummvm/trunk/gui/browser.cpp	2006-04-28 23:15:43 UTC (rev 22197)
@@ -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 @@
 }
 
 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::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)


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list