Thread Previous • Date Previous • Date Next • Thread Next |
Hell Carsten, On 08/04/18 13:33, Carsten Schoenert wrote:
yes, its not obvious from the patch I sent, because I left that code unmodified, but the config path is obtained using the wx call: wxStandardPaths::Get().GetUserConfigDir() Kicad doesn't know about the platform specifics, it relies on wx to provide them.Am 07.04.18 um 17:34 schrieb Strontium:Attached is a patch for discussion only. Its the minimum change I could come up with to implement a unique version specific config directory. Nick mentioned changing XDG_CONFIG_HOME, that will not work on Windows or Mac. And on Linux, etc it will change from "~/.config/kicad" to "~/somethingelse/kicad" which would work, but isn't a very friendly naming scheme.Changing XDG_CONFIG_HOME itself wouldn't be correct. XDG_CONFIG_HOME is pointing to '$HOME/.config' and XDG_DATA_HOME is referencing to $HOME/.local/share. I'm sure Windows and Mac have similar variables for the folders that should contain the logical same content.
ONLY if the platform is not windows or mac will it also read "XDG_CONFIG_HOME" and use that for the base of the configuration directories. My patch does not change how kicad gets the configuration path, it only allows there to be two paths and if it has to create the current path, it copies the configuration from the previous config path, in order that current configuration is preserved on a version upgrade but not changed for the previous version.
I suspected as much, however I do not know how one would go about that for kicad. As to whether we do this now, later, or at all, The jury is still out, I just was looking at the scope of the change should kicad decide to do something like this.The path to the KiCad user config must based on such variables plus the preferred name for the config folder, so like kicad-5 (for KiCad5) and kicad-6 (for future version KiCad6) and kicad-nightly (for devel version). GTK is doing this for a long time.$ find ~/.config -type d -name gtk* /home/carsten/.config/gtk-3.0 /home/carsten/.config/gtk-2.0If KiCad will introduce some version specific user config and data folders (which I appreciate to see) it will be needed to configured by the build environment and not hard-coded in the binaries.
It would be easy enough to add a unique environment variable which superseded XDG_CONFIG_HOME if set. Is this portable to windows and mac though?The variables can be overwritten with some additional value given while starting the applications. e.g. take the default folders $ kicad override the setting for the default config etc. $ KICAD_XDG_CONFIG_HOME=/my/special/folder kicad
Thread Previous • Date Previous • Date Next • Thread Next |