From 52f313032b86aaeb9371667bf53430e3de5fa7d4 Mon Sep 17 00:00:00 2001 From: Vinicius Moreira Date: Tue, 22 Oct 2019 12:34:09 -0300 Subject: [PATCH] fix: not loading application icons after some filters are applied to the table results --- CHANGELOG.md | 1 + bauh/view/qt/thread.py | 6 ++++++ bauh/view/qt/window.py | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bcd2e32..c376530a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixes - application not initializing when there is no internet connection +- not loading application icons after some filters are applied to the table results - AUR: - update-checking for some scenarios - not respecting **ignorepkg** settings in **pacman.conf** diff --git a/bauh/view/qt/thread.py b/bauh/view/qt/thread.py index 75a95e12..2f96d799 100644 --- a/bauh/view/qt/thread.py +++ b/bauh/view/qt/thread.py @@ -352,6 +352,7 @@ class VerifyModels(QThread): def __init__(self, apps: List[PackageView] = None): super(VerifyModels, self).__init__() self.apps = apps + self.work = True def run(self): @@ -361,6 +362,10 @@ class VerifyModels(QThread): last_ready = 0 while True: + + if not self.work: + break + current_ready = 0 for app in self.apps: @@ -379,6 +384,7 @@ class VerifyModels(QThread): time.sleep(0.1) + self.work = True self.apps = None diff --git a/bauh/view/qt/window.py b/bauh/view/qt/window.py index cafe6280..c428f7a9 100755 --- a/bauh/view/qt/window.py +++ b/bauh/view/qt/window.py @@ -314,6 +314,12 @@ class ManageWindow(QWidget): self._update_table(pkgs_info=pkgs_info, signal=True) self.update_bt_upgrade(pkgs_info) + if self.pkgs_available: + self.thread_verify_models.work = False + self.thread_verify_models.wait(50) + self.thread_verify_models.apps = self.pkgs_available + self.thread_verify_models.start() + def _finish_apply_filters_async(self, success: bool): self.label_status.setText('') self.ref_toolbar_search.setVisible(True)