aboutsummaryrefslogtreecommitdiff
path: root/gui/browser.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-07-10 11:12:11 +0000
committerTravis Howell2006-07-10 11:12:11 +0000
commit175c951e8ea2977810c946045dc15252a6f2c49e (patch)
tree0def0f309d784ca4657a283c5848b5e2cd0f67fe /gui/browser.cpp
parent924ff9169b7003da7965fa2538d593372e6035a0 (diff)
downloadscummvm-rg350-175c951e8ea2977810c946045dc15252a6f2c49e.tar.gz
scummvm-rg350-175c951e8ea2977810c946045dc15252a6f2c49e.tar.bz2
scummvm-rg350-175c951e8ea2977810c946045dc15252a6f2c49e.zip
Add cyx's patch for #1497725 - GUI: trying to enter empty CD drive
svn-id: r23475
Diffstat (limited to 'gui/browser.cpp')
-rw-r--r--gui/browser.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/gui/browser.cpp b/gui/browser.cpp
index 59ab8ee5ae..40d5121458 100644
--- a/gui/browser.cpp
+++ b/gui/browser.cpp
@@ -221,14 +221,18 @@ 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
- _node.listDir(_nodeContent, _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
- : FilesystemNode::kListAll);
- Common::sort(_nodeContent.begin(), _nodeContent.end());
+ FilesystemNode::ListMode listMode = _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
+ : FilesystemNode::kListAll;
+ if (!_node.listDir(_nodeContent, listMode)) {
+ _nodeContent.clear();
+ } else {
+ Common::sort(_nodeContent.begin(), _nodeContent.end());
+ }
// Populate the ListWidget
Common::StringList list;