Fix behavior of __get_contained_files_count when passed file id parameter and thus fix bug causing discrepancy in behavior when (un)selecting partially selected folders(will now unselect them all the time)

This commit is contained in:
Asmageddon 2012-03-09 20:35:16 +01:00
parent a8a24bf0d9
commit 6b8428e262
1 changed files with 3 additions and 3 deletions

View File

@ -370,7 +370,7 @@ class TorrentDetail(BaseMode, component.Component):
if element[1] == idx: if element[1] == idx:
return self.__get_contained_files_count(file_list = element[3]) return self.__get_contained_files_count(file_list = element[3])
elif element[3]: elif element[3]:
c = self.__get_contained_files_count(file_list = element[3], idx=element[1]) c = self.__get_contained_files_count(file_list = element[3], idx=idx)
if c > 0: if c > 0:
return c return c
else: else:
@ -520,8 +520,8 @@ class TorrentDetail(BaseMode, component.Component):
#Not selected, select it #Not selected, select it
self.__mark_tree(self.file_list, idx) self.__mark_tree(self.file_list, idx)
elif self.marked[idx] < fc: elif self.marked[idx] < fc:
#Partially selected, select all contents #Partially selected, unselect all contents
self.__mark_tree(self.file_list, idx) self.__unmark_tree(self.file_list, idx)
else: else:
#Selected, unselect it #Selected, unselect it
self.__unmark_tree(self.file_list, idx) self.__unmark_tree(self.file_list, idx)