From 99a9f522974d5cec31001a1a401bb76b3df4de7c Mon Sep 17 00:00:00 2001 From: Jean-Philippe Ouellet Date: Tue, 22 Nov 2016 03:38:37 -0500 Subject: [PATCH] Use more idiomatic python in VM filtering --- qubesmanager/main.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 913ac2b..f66ccbc 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -682,13 +682,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): def showhide_vms(self, show_inactive, show_internal): if show_inactive and show_internal: - row_no = 0 - while row_no < self.table.rowCount(): + for row_no in xrange(self.table.rowCount()): self.table.setRowHidden(row_no, False) - row_no += 1 else: - row_no = 0 - while row_no < self.table.rowCount(): + for row_no in xrange(self.table.rowCount()): widget = self.table.cellWidget(row_no, self.columns_indices["State"]) running = widget.vm.last_running @@ -698,7 +695,6 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): self.table.setRowHidden(row_no, True) else: self.table.setRowHidden(row_no, False) - row_no += 1 def mark_table_for_update(self): self.reload_table = True