← Back to team overview

kicad-developers team mailing list archive

Re: Fwd: Re: Config file relocation


2014-09-01 2:35 GMT+02:00 Moses McKnight <moses@xxxxxxxxxxx>:
> On 08/31/2014 11:07 AM, jp charras wrote:
>> Le 31/08/2014 13:59, Moses McKnight a écrit :
>>> -------- Original Message --------
>>> Subject: Re: [Kicad-developers] Config file relocation
>>> Date: Sun, 31 Aug 2014 06:58:31 -0500
>>> From: Moses McKnight <moses@xxxxxxxxxxx>
>>> To: Lorenzo Marcantonio <l.marcantonio@xxxxxxxxxxxx>
>>> On 08/31/2014 03:27 AM, Lorenzo Marcantonio wrote:
>>>> On Sat, Aug 30, 2014 at 07:56:16PM -0500, Moses McKnight wrote:
>>>>> Hi,
>>>>> I would like to move the kicad config files in linux to a more "proper"
>>>>> location as defined by the FreeDesktop specification here:
>>>>> http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
>>>>> Specifically this would put the files in $HOME/.config/kicad.
>>>> Yay for not putting junk in the home :D having here the fp-lib-table is
>>>> really ugly. I don't care if it's .config/kicad or .kicad (I don't
>>>> really like many of the freedesktop standard) but having all the stuff
>>>> in one place is really better.
>>>>> At first I thought I could just change bin_mod.cpp, but figured out
>>>>> that
>>>>> there were three other places that would need changing as well to catch
>>>>> everything.  So I made a new function in common.h/.cpp called
>>>>> GetNewConfig(...) and changed the four other files to call that
>>>>> instead of
>>>>> creating a wxConfig() object.
>>>> Be warned: IIRC there were also serious issues on windows since the
>>>> config classes in wx are tied to the registry or something like that (I
>>>> tried to do that in the past, it didn't go well :D); careful checking is
>>>> needed.
>>> As I mentioned, I didn't change how it is done in Windows, so the
>>> configs are still in the registry there.  If desired it would be trivial
>>> to put them in config files in %APPADATA%\kicad as well.  wxConfig by
>>> default uses the registry in Windows, but that can be changed easily.
>> I tested it on Linux and On Windows.
>> It works fine.
>> If nobody complains, I'll commit you patch soon.
>> Thanks.
> Do you think it would be good to make it automatically move the old files to
> the new location, or just inform the users of the need to do that if they
> don't want to re-enter their settings?  The file names in ~/.config/kicad
> will not have the dot in front, so instead of ".eeschema" it will be simply
> "eeschema".  If it would be better to still have them be dot files, I can
> change that.  This would make it so the old config files could simply be
> moved and not have to be re-named - if it is done manually.
> Also, should the global fp-lib-table be moved as well?  I did not look at
> that one.
> Thanks,
> Moses

I see no reason to keep the dot when moved to .config/kicad . I know
that you are not really supposed to edit .eeschema by had normally.
But I see no reason hiding it.

I am still not very keen on copying the files, that could lead to
confusion, because then you will have two configs, where the new copy
is the only one read by kicad. But the user still has the old config
in its usual place. Moving might be better. But the user shall be
informed when this happens, such that he do not think it has
dissapeared magically or erroneously. (I have yet to try the patch)

A transition period could be ok, but I am reluctant to move the stuff,
because it breaks the compatibility with previous versions. Which is
not so nice if you try to locate a bug that has recently creeped in.
So I think kicad should search the old paths.


Follow ups