This patch ensures the XDG_DATA_DIRS will be properly altered and only when necessary. This implies:
- If the data root is already in XDG_DATA_DIRS either in the value or in the spec's default value, the value will remain unchanged.
- If the data root is not in the value yet, it will be prepended, thus given preference over other prefixes containing KDE resources. This is what I believe was the intention of the original code.
Furthermore this restores the proper preference order of the default value.
BUG: 315452