FLTK logo

Re: [fltk/fltk] Matt: accumulated Fl_Preferences issues, are there more? (Issue #303)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Matt: accumulated Fl_Preferences issues, are there more? (Issue #303) Albrecht Schlosser Jan 21, 2022  
 

@MatthiasWM Some more info:

So does the pure existence of /home/albrecht/.config/ imply that XDG is supported?

I think that we should always test for more than one option. IMHO it's most important to find existing files so users don't lose their preferences.

On my system (i.e. for me as user albrecht) $XDG_CONFIG_HOME is not defined at all but nevertheless there are lots of files (11) and subdirectories (58) in ~/.config. The spec says:

$XDG_CONFIG_HOME defines the base directory relative to which user-specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.

The latter seems to be the case on my system and this is why Git works as described above and why all the other configs are stored in $HOME/.config (/home/albrecht/.config). But there are still lots of other config files in the old .<application> config dirs.

There are similar defaults for system config files IIRC, but that's another (although related) problem.

I think if we can make sure that we don't ignore existing files we should always create new preferences files in the "new" (XDG) directories even if $XDG_CONFIG_HOME is not defined (see default definition above). The next time we try to read this file we'd find it.

The only problem with this strategy would be if a user uses both FLTK 1.3 and FLTK 1.4 on the same system. FLTK 1.3 would only find the "old" location (even if a file exists in the "new" location) and FLTK 1.4 would create new files in the "new" location if an old file does not exist. This could be confusing, for instance: run fluid (1.4) on a new system, this creates $XDG_CONFIG_HOME/... preferences. Then run fluid (1.3) which would create $HOME/.fltk/... preferences - which ends up having both preferences files.


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.Message ID: <fltk/fltk/issues/303/1018785417@github.com>

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.