Code review comment for lp:~widelands-dev/widelands/add-xdg-support

Revision history for this message
Lucki (lucki1) wrote :

 I'm sorry I confused you.

I wasn't aware that there was a 'compile.sh'. I have now adjusted them additionally.

A little more explanation:
Because the general acceptance of this change in the linked bug report was rather low, this setting must be explicitly activated. This can now be done with './compile.sh --with-xdg' or 'cmake .. -DUSE_XDG=ON'.
These changes only affect Linux, so Apple and Windows should be excluded in the 'CMakeLists.txt'. I cannot test this part due to a lack of operating systems. If the option is activated on Apple or Windows against expectation, the filter in the 'CMakeLists.txt' should still prevent the option from being activated on the wrong operating systems. These changes should have no effect on Apple and Windows. Hopefully.
You are right that these changes only affect complete new installations or require a manual move of the relevant folder. In addition, this option must be activated separately. This was chosen because, as I said, acceptance of these changes was rather low.
If the option is enabled and no folder '$HOME/.widelands' exists, the folder is created or used in '$XDG_DATA_HOME/widelands'. If the variable '$XDG_DATA_HOME' is not set, '$HOME/.local/share/widelands' is used as fallback. If the variable '$HOME' is not available or an error occurs in the query, the current working folder './.widelands' is used - this is another fallback I took from the above function.

Hopefully this option will be used by the package maintainers in the future. :)

« Back to merge proposal