Fix deprecation warning when clearing downloads.
This commit is contained in:
parent
3fcc27636a
commit
da88908815
@ -125,6 +125,7 @@ class DownloadView(QListView):
|
|||||||
- (QAction, callable) tuples.
|
- (QAction, callable) tuples.
|
||||||
- (None, None) for a separator
|
- (None, None) for a separator
|
||||||
"""
|
"""
|
||||||
|
model = self.model()
|
||||||
actions = []
|
actions = []
|
||||||
if item is None:
|
if item is None:
|
||||||
pass
|
pass
|
||||||
@ -134,13 +135,12 @@ class DownloadView(QListView):
|
|||||||
else:
|
else:
|
||||||
actions.append(("Retry", item.retry))
|
actions.append(("Retry", item.retry))
|
||||||
actions.append(("Remove",
|
actions.append(("Remove",
|
||||||
functools.partial(self.model().remove_item, item)))
|
functools.partial(model.remove_item, item)))
|
||||||
else:
|
else:
|
||||||
actions.append(("Cancel", item.cancel))
|
actions.append(("Cancel", item.cancel))
|
||||||
if self.model().can_clear():
|
if model.can_clear():
|
||||||
actions.append((None, None))
|
actions.append((None, None))
|
||||||
actions.append(("Remove all finished", functools.partial(
|
actions.append(("Remove all finished", model.download_clear))
|
||||||
self.model().download_remove, True)))
|
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
@pyqtSlot('QPoint')
|
@pyqtSlot('QPoint')
|
||||||
|
Loading…
Reference in New Issue
Block a user