X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/da1955116b7e8b8c203e27c7e5994537219a0632..2a8ecd871020fdd668cf5500460e5a6e7851b4b0:/lib/python/Components/FileList.py diff --git a/lib/python/Components/FileList.py b/lib/python/Components/FileList.py index d842cfef..e6e072cd 100644 --- a/lib/python/Components/FileList.py +++ b/lib/python/Components/FileList.py @@ -78,7 +78,20 @@ class FileList(MenuList): # if we are just entering from the list of mount points: if self.current_directory is None: - self.mount_point = directory + if directory is None: + self.mount_point = None + else: + # Sort Mountpoints by length (longest first) + sortedp = harddiskmanager.getMountedPartitions() + sortedp.sort(key=lambda p: 0 - len(p.mountpoint)) + + # Search for the longest matching mp (should at least match /) + for p in sortedp: + if directory.startswith(p.mountpoint): + self.mount_point = p.mountpoint + if p.mountpoint != "/": + self.mount_point += "/" + break self.current_directory = directory directories = [] files = []