From d42c99fc873646d984be6b1c52d11e10c71b7be5 Mon Sep 17 00:00:00 2001
From: Tim Lauridsen <tla@rasmil.dk>
Date: Thu, 24 Jun 2021 14:54:10 +0200
Subject: [PATCH] make then group installed check work as in current dnf

---
 python/dnfdaemon/server/__init__.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/python/dnfdaemon/server/__init__.py b/python/dnfdaemon/server/__init__.py
index 1aa504e..0620546 100644
--- a/python/dnfdaemon/server/__init__.py
+++ b/python/dnfdaemon/server/__init__.py
@@ -252,8 +252,13 @@ class DnfDaemonBase(dbus.service.Object, DownloadCallback):
             cat = (category.name, category.ui_name, category.ui_description)
             cat_grps = []
             for grp in category.groups_iter():
-                # FIXME: dnf API dont tell up if a group is installed
-                installed = False
+                # FIXME: dnf.base.history is not public API
+                # this is how dnf cli does it in dnf group list
+                group_found = self.base.history.group.get(grp.id)
+                if group_found:
+                    installed = True
+                else:
+                    installed = False
                 elem = (grp.id, grp.ui_name,
                         grp.ui_description, installed)
                 cat_grps.append(elem)
-- 
GitLab