changeset 3114:060ac43627fc

quick frontend (widgets): fixed widget creation in getOrCreateWidget: when a new widget was created, it was overwritting the exiting instances list. This patch fixes it.
author Goffi <goffi@goffi.org>
date Fri, 17 Jan 2020 17:55:57 +0100
parents b067736d5099
children 3018d153a615
files sat_frontends/quick_frontend/quick_widgets.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/sat_frontends/quick_frontend/quick_widgets.py	Fri Jan 17 15:27:39 2020 +0100
+++ b/sat_frontends/quick_frontend/quick_widgets.py	Fri Jan 17 17:55:57 2020 +0100
@@ -225,7 +225,7 @@
             # we need to create a new widget
             log.debug("Creating new widget for target {} {}".format(target, cls))
             widget = cls(*_args, **_kwargs)
-            widgets_map[hash_] = [widget]
+            widgets_map.setdefault(hash_, []).append(widget)
 
             if on_new_widget == C.WIDGET_NEW:
                 self.host.newWidget(widget)