From d8a6e4a4b197acccb2625dea198acdeb53f99007 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 12 Jan 2014 05:17:41 +0100 Subject: [PATCH] backups: simplify getting dom0 object --- qubesmanager/backup.py | 5 +---- qubesmanager/restore.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index f21fa13..f44e36e 100644 --- a/qubesmanager/backup.py +++ b/qubesmanager/backup.py @@ -69,10 +69,7 @@ class BackupVMsWindow(Ui_Backup, QWizard): self.func_output = [] self.selected_vms = [] - for vm in self.qvm_collection.values(): - if vm.qid == 0: - self.vm = vm - break; + self.vm = self.qvm_collection[0] assert self.vm != None diff --git a/qubesmanager/restore.py b/qubesmanager/restore.py index 8e5db99..2c1f3c7 100644 --- a/qubesmanager/restore.py +++ b/qubesmanager/restore.py @@ -70,10 +70,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard): self.excluded = {} - for vm in self.qvm_collection.values(): - if vm.qid == 0: - self.vm = vm - break; + self.vm = self.qvm_collection[0] assert self.vm != None