git.cweiske.de
/
enigma2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a5aad8
)
fix_detecting_mountpoint_in_filelist.patch by Moritz Venn
author
Felix Domke
<tmbinc@elitedvb.net>
Wed, 20 Feb 2008 00:42:29 +0000
(
00:42
+0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Wed, 20 Feb 2008 00:42:29 +0000
(
00:42
+0000)
lib/python/Components/FileList.py
patch
|
blob
|
history
diff --git
a/lib/python/Components/FileList.py
b/lib/python/Components/FileList.py
index d842cfefbe353de786cdb353f0bff09a3b0fbdf9..e6e072cdf69a18767987dd9414d0b7b910b72bbc 100644
(file)
--- 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:
# 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 = []
self.current_directory = directory
directories = []
files = []