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

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