Hello, I’ve seen that there’s been some interest in adding XDG specification support to the way that abook determines its directories for data and config files in this feature request: The attached patch attempts to fulfil that request by applying the following changes to abook.c: in abook_check_directory: - determine whether XDG_DATA_DIR is set in the environment, and if not, default to $HOME/.local/share/ as per the specification - determine whether XDG_DATA_DIR/abook exists, and, if not - determine whether HOME/.abook exists, and, if not - create HOME/.abook in short, do not create HOME/.abook if a supported location — including the XDG specified HOME/.local/share/abook — exists. in set_filenames for datafile: - determine whether XDG_DATA_DIR is set in the environment, and if not, default to $HOME/.local/share/ as per the specification - determine whether XDG_DATA_DIR/abook/addressbook exists - if it exists, use it as datafile, otherwise continue with the previous behaviour in set_filenames for configfile - determine whether XDG_CONFIG_DIR is set in the environment, and if not, default to $HOME/.local/share/ as per the specification - determine whether XDG_CONFIG_DIR/abook/abookrc exists - if it exists, use it as configfile, otherwise continue with the previous behaviour This behaviour is identical to the previous behaviour on existing installations, and will produce expected behaviour on future installations, while allowing users to customise their installation by moving their data folder to the XDG specified location, where abook will then be able to pick it up with the changes. Documentation changes are included in the patch. If you want anything changed with this patch, please let me know. I’ll happily go through a couple of iterations to get this right :) Thanks for your time, Andreas |
0001-abook.c-abook.h-enable-support-for-XDG_CONFIG_HOME-a.patch
Description: Binary data
_______________________________________________ Abook-devel mailing list Abook-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/abook-devel