Improve XDG Base Directory Specification implementation#1609
Merged
obiltschnig merged 1 commit intopocoproject:developfrom Feb 23, 2017
Merged
Improve XDG Base Directory Specification implementation#1609obiltschnig merged 1 commit intopocoproject:developfrom
obiltschnig merged 1 commit intopocoproject:developfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This builds upon #561 .
The XDG Base Directory Specification requires that the end user can specify a custom location for their config, data, and cache directories, simply by changing the values of three environment variables (XDG_CONFIG_HOME, XDG_DATA_HOME, XDG_CACHE_HOME). In case any of those is unset or empty, its default should be used.
#561 implements the spec only partially: it always returns the default values (~/.config, ~/.local/share, ~/.cache), regardless of the values of the aforementioned environment variables.
This PR implements the missing functionality.
Furthermore, #561 added the concept of a userwide temporary directory. This concept does not exist in the XDG Base Dir Spec. I have personally never seen such a thing on any of the unix systems I have used either. If the application wants a real temp dir, it should use /tmp, which is automatically cleared on reboot. Otherwise it should use the cache dir (or, if it really wants system-wide persistent temp, it may use /var/tmp).
#561 defined this userwide temp to be ~/.local/tmp on unixes (and equal to the normal temp on other systems), but I find this to be a bad idea, because on the one hand it is not standard, and on the other hand, it is not automatically cleared, and thus would become a place that slowly fills up the disk with garbage (for those semantics, use the cache dir instead).
Based on this reasoning, this PR removes the Poco::Path::tempHome() function and its implementation.