1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-09-28 19:30:23 +03:00

Do not list ".." as a subdirectory of the root directory

In Linux "/.." exists and loops back onto the root. But for the user
it is confusing to see a ".." entry listed that does nothing when
selected, so hide it.
This commit is contained in:
Maarten ter Huurne 2014-08-17 10:15:15 +02:00
parent 0b0e278459
commit 20725fcdda

View File

@ -88,7 +88,7 @@ bool FileLister::browse(const string& path, bool clean)
while (struct dirent *dptr = readdir(dirp)) {
// Ignore hidden files and optionally "..".
if (dptr->d_name[0] == '.') {
if (!(dptr->d_name[1] == '.' && showUpdir)) {
if (!(dptr->d_name[1] == '.' && showUpdir && slashedPath != "/")) {
continue;
}
}