aboutsummaryrefslogtreecommitdiff
path: root/lib/python
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2008-02-20 00:42:29 +0000
committerFelix Domke <tmbinc@elitedvb.net>2008-02-20 00:42:29 +0000
commit522a7e522d8d59344f85cef9245b2dc3695bc166 (patch)
tree3fff194ea09c05249475a511e9528701dccf752c /lib/python
parent4a5aad8a0d22f84f934f216ca33d1274fc3df89e (diff)
downloadenigma2-522a7e522d8d59344f85cef9245b2dc3695bc166.tar.gz
enigma2-522a7e522d8d59344f85cef9245b2dc3695bc166.zip
fix_detecting_mountpoint_in_filelist.patch by Moritz Venn
Diffstat (limited to 'lib/python')
-rw-r--r--lib/python/Components/FileList.py15
1 files changed, 14 insertions, 1 deletions
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 = []