diff --git a/src/gui/FileListWidget.cxx b/src/gui/FileListWidget.cxx index 0f823c2ca..533e5f054 100644 --- a/src/gui/FileListWidget.cxx +++ b/src/gui/FileListWidget.cxx @@ -53,7 +53,7 @@ void FileListWidget::setLocation(const FilesystemNode& node, string select) // Add '[..]' to indicate previous folder if(_node.hasParent()) - _gameList.appendGame("[..]", _node.getParent().getPath(), "", true); + _gameList.appendGame(" [..]", _node.getParent().getPath(), "", true); // Now add the directory entries for(const auto& file: content) @@ -61,7 +61,7 @@ void FileListWidget::setLocation(const FilesystemNode& node, string select) string name = file.getName(); bool isDir = file.isDirectory(); if(isDir) - name = "[" + name + "]"; + name = " [" + name + "]"; else if(!BSPF::endsWithIgnoreCase(name, _extension)) continue; @@ -109,7 +109,7 @@ void FileListWidget::handleCommand(CommandSender* sender, int cmd, int data, int if(_gameList.isDir(data)) { cmd = ItemChanged; - if(_gameList.name(data) == "[..]") + if(_gameList.name(data) == " [..]") selectParent(); else setLocation(FilesystemNode(_gameList.path(data))); diff --git a/src/gui/GameList.cxx b/src/gui/GameList.cxx index dc97971af..8447a273a 100644 --- a/src/gui/GameList.cxx +++ b/src/gui/GameList.cxx @@ -31,10 +31,6 @@ void GameList::sortByName() auto cmp = [](const Entry& a, const Entry& b) { - // directories always first - if(a._isdir != b._isdir) - return a._isdir; - auto it1 = a._name.cbegin(), it2 = b._name.cbegin(); // Account for ending ']' character in directory entries diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 41725c56a..b5bd8776f 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -294,14 +294,14 @@ void LauncherDialog::loadDirListing() // Add '[..]' to indicate previous folder if(myCurrentNode.hasParent()) - myGameList->appendGame("[..]", "", "", true); + myGameList->appendGame(" [..]", "", "", true); // Now add the directory entries bool domatch = myPattern && myPattern->getText() != ""; for(const auto& f: files) { bool isDir = f.isDirectory(); - const string& name = isDir ? ("[" + f.getName() + "]") : f.getName(); + const string& name = isDir ? (" [" + f.getName() + "]") : f.getName(); // Honour the filtering settings // Showing only certain ROM extensions is determined by the extension @@ -461,7 +461,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd, if(romnode.isDirectory()) { string dirname = ""; - if(myGameList->name(item) == "[..]") + if(myGameList->name(item) == " [..]") { myCurrentNode = myCurrentNode.getParent(); if(!myNodeNames.empty())