XDG_DATA_DIRS not appendable with glib generated directories
We have discovered a problem trying to add a directory to the XDG_DATA_DIRS
If we set the environment variable, then it overrides any of the directories which would be generated internally.
If we ask glib what directories it would have generated, then it caches it's results and it won't let us clear the cache. Making changing the environment variables ineffective.
This is the code we have had to develop to work around the problem:
This is not ideal code. But we can't think of a way around it.