Skip to content

Commit

Permalink
setCurrentItem() -> setCurrentIndex()
Browse files Browse the repository at this point in the history
  • Loading branch information
donob4n committed Jul 12, 2020
1 parent 10bac8d commit bc288b6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions qubesmanager/tests/test_qube_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit bc288b6

Please sign in to comment.