From ce5b014f7d6719a2990908b161ddafb39452da02 Mon Sep 17 00:00:00 2001 From: signedav Date: Thu, 8 Dec 2022 10:50:22 +0100 Subject: [PATCH] fix that group entry in mapthems got overwritten --- toppingmaker/projecttopping.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toppingmaker/projecttopping.py b/toppingmaker/projecttopping.py index 4fb7885..fadd180 100644 --- a/toppingmaker/projecttopping.py +++ b/toppingmaker/projecttopping.py @@ -397,12 +397,16 @@ def make_items( if maptheme_record.hasExpandedStateInfo(): for expanded_groupnode in maptheme_record.expandedGroupNodes(): - maptheme_item[expanded_groupnode] = {} + if expanded_groupnode not in maptheme_item: + maptheme_item[expanded_groupnode] = {} + maptheme_item[expanded_groupnode]["group"] = True maptheme_item[expanded_groupnode]["expanded"] = True # setHasCheckedStateInfo(True) is not available in the API, what makes it impossible to control the checked state of a group # see https://github.com/SebastienPeillet/QGIS/commit/736e46daa640b8a9c66107b4f05319d6d2534ac5#discussion_r1037225879 for checked_groupnode in maptheme_record.checkedGroupNodes(): - maptheme_item[checked_groupnode] = {} + if checked_groupnode not in maptheme_item: + maptheme_item[checked_groupnode] = {} + maptheme_item[checked_groupnode]["group"] = True maptheme_item[checked_groupnode]["checked"] = True self[name] = maptheme_item