Fix get_selected_torrents() when removing multiple torrents.
This commit is contained in:
parent
5ab95814e7
commit
3ccfb4e03e
|
@ -385,15 +385,25 @@ class TorrentView(listview.ListView, component.Component):
|
|||
return []
|
||||
try:
|
||||
for path in paths:
|
||||
torrent_ids.append(
|
||||
self.model_filter.get_value(
|
||||
self.model_filter.get_iter(path), 0))
|
||||
try:
|
||||
row = self.model_filter.get_iter(path)
|
||||
except Exception, e:
|
||||
log.debug("Unable to get iter from path: %s", e)
|
||||
|
||||
if len(torrent_ids) is 0:
|
||||
child_row = self.model_filter.convert_iter_to_child_iter(None, row)
|
||||
child_row = self.model_filter.get_model().convert_iter_to_child_iter(child_row)
|
||||
if self.liststore.iter_is_valid(child_row):
|
||||
try:
|
||||
value = self.liststore.get_value(child_row, 0)
|
||||
except Exception, e:
|
||||
log.debug("Unable to get value from row: %s", e)
|
||||
else:
|
||||
torrent_ids.append(value)
|
||||
if len(torrent_ids) == 0:
|
||||
return []
|
||||
|
||||
return torrent_ids
|
||||
except ValueError:
|
||||
except ValueError, TypeError:
|
||||
return []
|
||||
|
||||
def get_torrent_status(self, torrent_id):
|
||||
|
|
Loading…
Reference in New Issue