Blame SOURCES/oscap-anaconda-addon-1.3.0-clicking_nocrash-PR_221.patch

36d401
From 55cc3b685dd5a9ca6059459f41876dd9f19f900d Mon Sep 17 00:00:00 2001
36d401
From: Matej Tyc <matyc@redhat.com>
36d401
Date: Tue, 11 Oct 2022 17:07:28 +0200
36d401
Subject: [PATCH 1/2] Remove redundant message
36d401
36d401
The send_ready already performs what the removed call
36d401
could aim to accomplish.
36d401
---
36d401
 org_fedora_oscap/gui/spokes/oscap.py | 1 -
36d401
 1 file changed, 1 deletion(-)
36d401
36d401
diff --git a/org_fedora_oscap/gui/spokes/oscap.py b/org_fedora_oscap/gui/spokes/oscap.py
36d401
index c57b1cd..4f8702a 100644
36d401
--- a/org_fedora_oscap/gui/spokes/oscap.py
36d401
+++ b/org_fedora_oscap/gui/spokes/oscap.py
36d401
@@ -150,7 +150,6 @@ def decorated(self, *args, **kwargs):
36d401
         self._ready = True
36d401
         # pylint: disable-msg=E1101
36d401
         hubQ.send_ready(self.__class__.__name__, True)
36d401
-        hubQ.send_message(self.__class__.__name__, self.status)
36d401
 
36d401
         return ret
36d401
 
36d401
36d401
From 3f7c560947a17d1696899857e70ebcc8cba44019 Mon Sep 17 00:00:00 2001
36d401
From: Matej Tyc <matyc@redhat.com>
36d401
Date: Thu, 13 Oct 2022 17:19:17 +0200
36d401
Subject: [PATCH 2/2] Increase robustness of fetching state detection
36d401
36d401
It is not completely practical to rely on locks alone,
36d401
and we can elliminate some corner cases by looking
36d401
whether well-known UI threads exist.
36d401
---
36d401
 org_fedora_oscap/gui/spokes/oscap.py | 9 ++++++---
36d401
 1 file changed, 6 insertions(+), 3 deletions(-)
36d401
36d401
diff --git a/org_fedora_oscap/gui/spokes/oscap.py b/org_fedora_oscap/gui/spokes/oscap.py
36d401
index 4f8702a..d8e6ce2 100644
36d401
--- a/org_fedora_oscap/gui/spokes/oscap.py
36d401
+++ b/org_fedora_oscap/gui/spokes/oscap.py
36d401
@@ -363,11 +363,14 @@ def _render_selected(self, column, renderer, model, itr, user_data=None):
36d401
         else:
36d401
             renderer.set_property("stock-id", None)
36d401
 
36d401
+    def _still_fetching(self):
36d401
+        return self._fetching or threadMgr.get('OSCAPguiWaitForDataFetchThread')
36d401
+
36d401
     def _fetch_data_and_initialize(self):
36d401
         """Fetch data from a specified URL and initialize everything."""
36d401
 
36d401
         with self._fetch_flag_lock:
36d401
-            if self._fetching:
36d401
+            if self._still_fetching():
36d401
                 # prevent multiple fetches running simultaneously
36d401
                 return
36d401
             self._fetching = True
36d401
@@ -894,7 +897,7 @@ def refresh(self):
36d401
 
36d401
             # hide the progress box, no progress now
36d401
             with self._fetch_flag_lock:
36d401
-                if not self._fetching:
36d401
+                if not self._still_fetching():
36d401
                     really_hide(self._progress_box)
36d401
 
36d401
                     self._content_url_entry.set_sensitive(True)
36d401
@@ -1117,7 +1120,7 @@ def on_fetch_button_clicked(self, *args):
36d401
         """Handler for the Fetch button"""
36d401
 
36d401
         with self._fetch_flag_lock:
36d401
-            if self._fetching:
36d401
+            if self._still_fetching():
36d401
                 # some other fetching/pre-processing running, give up
36d401
                 log.warn("Clicked the fetch button, although the GUI is in the fetching mode.")
36d401
                 return