From 5a82b6ee38e4094b42919d4d7ed1e283a9373846 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Fri, 16 Aug 2019 21:45:00 -0300 Subject: [PATCH] update thread improvements --- bauh/view/qt/thread.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bauh/view/qt/thread.py b/bauh/view/qt/thread.py index 12b47407..1c39ba1b 100644 --- a/bauh/view/qt/thread.py +++ b/bauh/view/qt/thread.py @@ -69,16 +69,20 @@ class UpdateSelectedApps(AsyncAction): success = False - for app in self.apps_to_update: - self.signal_status.emit(app.model.base_data.name) - success = self.manager.update(app.model, self.root_password, self) + if self.apps_to_update: + updated = 0 + for app in self.apps_to_update: + self.signal_status.emit(app.model.base_data.name) + success = bool(self.manager.update(app.model, self.root_password, self)) - if not success: - break - else: - self.signal_output.emit('\n') + if not success: + break + else: + updated += 1 + self.signal_output.emit('\n') + + self.signal_finished.emit(success, updated) - self.signal_finished.emit(success, len(self.apps_to_update)) self.apps_to_update = None def handle(self, proc: SystemProcess) -> bool: