diff --git a/qutebrowser/completion/completer.py b/qutebrowser/completion/completer.py index 92e774ed2..71202d131 100644 --- a/qutebrowser/completion/completer.py +++ b/qutebrowser/completion/completer.py @@ -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. diff --git a/qutebrowser/completion/completionwidget.py b/qutebrowser/completion/completionwidget.py index 8feefffd9..9fc1ef5d7 100644 --- a/qutebrowser/completion/completionwidget.py +++ b/qutebrowser/completion/completionwidget.py @@ -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.""" diff --git a/tests/unit/completion/test_completer.py b/tests/unit/completion/test_completer.py index c5b4ccdf8..29196ea3b 100644 --- a/tests/unit/completion/test_completer.py +++ b/tests/unit/completion/test_completer.py @@ -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)