From 738bcbe3578eec4e5fd831a344e003cac22ec5b6 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 22 May 2021 18:24:56 +0200 Subject: [PATCH] Draft: Fix "Show groups in layer list drop-down button" preference The code that was intended to handle this preference looked inside Mod/BIM instad of Mod/Draft for the preference. This seems to have been broken since the preference was first introduced in commit 507c40669d (Draft: Turned autogroup button into layers selector (added pref option to restore old groups-based system)). This also removes a stray "-" that was probably a leftover from a merge conflict, introduced in commit 68119de02f (Draft: move Draft_AutoGroup to gui_groups module). Since -True is still true and -False is still false, this did not actually break the code, though. See https://forum.freecadweb.org/viewtopic.php?t=42018 for related discussion. --- src/Mod/Draft/draftguitools/gui_groups.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Draft/draftguitools/gui_groups.py b/src/Mod/Draft/draftguitools/gui_groups.py index 705b920f96..a5d2b22988 100644 --- a/src/Mod/Draft/draftguitools/gui_groups.py +++ b/src/Mod/Draft/draftguitools/gui_groups.py @@ -258,7 +258,7 @@ class SetAutoGroup(gui_base.GuiCommandSimplest): s = Gui.Selection.getSelection() if len(s) == 1: if (utils.get_type(s[0]) == "Layer") or \ -- (App.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM").GetBool("AutogroupAddGroups", False) + (App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("AutogroupAddGroups", False) and (s[0].isDerivedFrom("App::DocumentObjectGroup") or utils.get_type(s[0]) in ["Site", "Building", "Floor", "BuildingPart"])): @@ -269,7 +269,7 @@ class SetAutoGroup(gui_base.GuiCommandSimplest): # including the options "None" and "Add new layer". self.groups = ["None"] gn = [o.Name for o in self.doc.Objects if utils.get_type(o) == "Layer"] - if App.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM").GetBool("AutogroupAddGroups", False): + if App.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft").GetBool("AutogroupAddGroups", False): gn.extend(groups.get_group_names()) if gn: self.groups.extend(gn)