From bc288b616b80a5fabe179954eb18953ee59c18bc Mon Sep 17 00:00:00 2001 From: donoban Date: Sun, 12 Jul 2020 17:03:22 +0200 Subject: [PATCH] setCurrentItem() -> setCurrentIndex() --- qubesmanager/tests/test_qube_manager.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/qubesmanager/tests/test_qube_manager.py b/qubesmanager/tests/test_qube_manager.py index 2297db5d..b56e11d8 100644 --- a/qubesmanager/tests/test_qube_manager.py +++ b/qubesmanager/tests/test_qube_manager.py @@ -791,8 +791,10 @@ def test_400_event_domain_added(self): # try opening settings for the added vm for row in range(self.dialog.table.model().rowCount()): name = self._get_table_item(row, "Name") - if name.text() == "test-vm": - self.dialog.table.setCurrentItem(name) + if name == "test-vm": + index = self.dialog.table.model().index(row, 0) + index = self.dialog.table.model().mapToSource(index) + self.dialog.table.setCurrentIndex(index) break with unittest.mock.patch('qubesmanager.settings.VMSettingsWindow')\ as mock_settings: @@ -1245,7 +1247,9 @@ def _select_templatevm(self, running=None): (running is None or (running and vm.is_running()) or (not running and not vm.is_running())): - self.dialog.table.setCurrentItem(template) + index = self.dialog.table.model().index(row, 0) + index = self.dialog.table.model().mapToSource(index) + self.dialog.table.setCurrentIndex(index) return template return None