Postby TheMarkster » Mon Aug 05, 2019 6:06 pm
I think you are right. The parameters should not be in BaseApp at all, but rather in Plugins. I need to change that now before too many people install it.
Edit: Done
New version 1.06.
It checks if the parameters exist in BaseApp/Preferences and relocates them to Plugins.
Addon Manager should probably have a mechanism for cleaning up user parameters when uninstalling macros and workbenches. But for that there would need to be a standard place to put them, perhaps Plugins/macro_name would work. Then when the addon manager uninstalls a macro it could also remove any parameter group named Plugins/macro_name. The user could be queried first if a preference group is found. For my workbenches I have them in BaseApp/Preferences/Mod/workbench_name, but I think BaseApp should be reserved only for FreeCAD base and workbenches that come pre-installed.
Perhaps there should be Plugins/Macros and Plugins/Workbenches heirarchy. But I don't think many macros use parameters anyway.
Alternatively, each macro that creates user parameter groups could implement a parameter cleanup function that the Addon manager calls when uninstalling, maybe something like def onUninstall(): and inside there cleanup any parameter groups / folders / files created. But this would require cooperation from macro writers, which would be hit or miss. Better, I think, to just check for a Plugins/macro_name group and remove it if the user wants to when uninstalling. Sometimes it could be the user wants to reinstall, and so wants to keep the settings.
There is no real harm in having orphaned parameters from uninstalled macros/workbenches, but it probably has a performance cost the bigger the user.cfg file becomes. The clutter would also make it more difficult for users to find parameters.