Closed uniquestring closed 6 years ago
I cloned this project to see if I could fix this myself.
After some time playing around, I noticed, that my original installation found the config all of a sudden.
All I did was installing libgtk-3-dev
and compiling gsimplecal a few times.
I checked if I replaced the original binary with the newly compiled one, but thats not the case. Also $XDG_CONFIG_HOME
is still not set.
I'll try to reproduce my original problem on a fresh VM. If I can reproduce it, I'll post details here.
gsimplecal uses the g_get_user_config_dir
function from glib: https://github.com/dmedvinsky/gsimplecal/blob/2dc6bbab18f51ee2ad0eb33f9b8ff48db849f95e/src/Config.cpp#L76
which in turn uses g_init_user_config_dir
internally: https://github.com/GNOME/glib/blob/0d49cd1b11b1bd0bae2671da9ddd83a6227eb947/glib/gutils.c#L1270
which actually does what you are describing is the desired behavior -- tries the env var first, then falls back to $HOME/.config
: https://github.com/GNOME/glib/blob/0d49cd1b11b1bd0bae2671da9ddd83a6227eb947/glib/gutils.c#L1234
So, my guess is maybe it somehow changed at some point in time and when installing libgtk-3-dev
you somehow updated the glib and compiled gsimplecal against the newer version which has this behavior?.. I'm not sure.
Gsimplecal doesn't find my configuration file, which is located at
~/.config/gsimplecal/config
. The reason for that is, that$XDG_CONFIG_HOME
isn't defined. I think this behaviour is a bug.Currently, gsimplecal's behaviour for searching the config file is decribed like this:
Problem is, that
$XDG_CONFIG_HOME
isn't always set. In fact, you should only need set it if you want to use a different location than$HOME/.config
The specification at freedesktop.org says:
Please add
$HOME/.config/gsimplecal/config
to the search locations. If you want to keep the$XDG_CONFIG_DIRS
part, you could search in this order:$XDG_CONFIG_HOME/gsimplecal/config
$HOME/.config/gsimplecal/config
$XDG_CONFIG_DIRS/gsimplecal/config