Merge remote-tracking branch 'qubesos/pr/11'

* qubesos/pr/11:
  Use more idiomatic python in VM filtering
This commit is contained in:
Marek Marczykowski-Górecki 2016-11-22 11:53:23 +01:00
commit 88eedc1a43
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -682,13 +682,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
def showhide_vms(self, show_inactive, show_internal): def showhide_vms(self, show_inactive, show_internal):
if show_inactive and show_internal: if show_inactive and show_internal:
row_no = 0 for row_no in xrange(self.table.rowCount()):
while row_no < self.table.rowCount():
self.table.setRowHidden(row_no, False) self.table.setRowHidden(row_no, False)
row_no += 1
else: else:
row_no = 0 for row_no in xrange(self.table.rowCount()):
while row_no < self.table.rowCount():
widget = self.table.cellWidget(row_no, widget = self.table.cellWidget(row_no,
self.columns_indices["State"]) self.columns_indices["State"])
running = widget.vm.last_running running = widget.vm.last_running
@ -698,7 +695,6 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
self.table.setRowHidden(row_no, True) self.table.setRowHidden(row_no, True)
else: else:
self.table.setRowHidden(row_no, False) self.table.setRowHidden(row_no, False)
row_no += 1
def mark_table_for_update(self): def mark_table_for_update(self):
self.reload_table = True self.reload_table = True