Remove second arg from on_selection_changed.

The deselected argument was unused, so remove it from the signal and
the slot.
This commit is contained in:
Ryan Roden-Corrent 2016-07-29 08:48:24 -04:00
parent e8f73b0fe6
commit fbadc5e668
3 changed files with 5 additions and 5 deletions

View File

@ -241,8 +241,8 @@ class Completer(QObject):
else:
return s
@pyqtSlot(QItemSelection, QItemSelection)
def on_selection_changed(self, selected, _deselected):
@pyqtSlot(QItemSelection)
def on_selection_changed(self, selected):
"""Change the completed part if a new item was selected.
Called from the views selectionChanged method.

View File

@ -104,7 +104,7 @@ class CompletionView(QTreeView):
"""
resize_completion = pyqtSignal()
selection_changed = pyqtSignal(QItemSelection, QItemSelection)
selection_changed = pyqtSignal(QItemSelection)
def __init__(self, win_id, parent=None):
super().__init__(parent)
@ -255,7 +255,7 @@ class CompletionView(QTreeView):
def selectionChanged(self, selected, deselected):
"""Extend selectionChanged to call completers selection_changed."""
super().selectionChanged(selected, deselected)
self.selection_changed.emit(selected, deselected)
self.selection_changed.emit(selected)
def resizeEvent(self, e):
"""Extend resizeEvent to adjust column size."""

View File

@ -216,6 +216,6 @@ def test_on_selection_changed(before, newtxt, count, quick_complete, after,
_set_cmd_prompt(status_command_stub, before)
# schedule_completion_update is needed to pick up the cursor position
completer_obj.schedule_completion_update()
completer_obj.on_selection_changed(selection, None)
completer_obj.on_selection_changed(selection)
model.data.assert_called_with(indexes[0])
_validate_cmd_prompt(status_command_stub, after)