Ticket #2638: 1497725.diff

File 1497725.diff, 1.0 KB (added by cyxx, 18 years ago)

Possible fix

  • gui/browser.cpp

     
    222222void BrowserDialog::updateListing() {
    223223        // Update the path display
    224224        _currentPath->setLabel(_node.path());
    225        
     225
    226226        // We memorize the last visited path.
    227227        ConfMan.set("browser_lastpath", _node.path());
    228228
    229229        // Read in the data from the file system
    230         _node.listDir(_nodeContent, _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
    231                                                   : FilesystemNode::kListAll);
    232         Common::sort(_nodeContent.begin(), _nodeContent.end());
     230        FilesystemNode::ListMode listMode = _isDirBrowser ? FilesystemNode::kListDirectoriesOnly
     231                                                          : FilesystemNode::kListAll;
     232        if (!_node.listDir(_nodeContent, listMode)) {
     233                _nodeContent.clear();
     234        } else {
     235                Common::sort(_nodeContent.begin(), _nodeContent.end());
     236        }
    233237
    234238        // Populate the ListWidget
    235239        Common::StringList list;