1) Modifying GetAppDataDirectory() to return a reasonable value for Unix-like systems. Following Cura's behavior, this directory is either $XDG_DATA_HOME, if it exists, or $HOME/.local/share otherwise. For now, only Linux and FreeBSD are supported, since this is what the .NET runtime supports, but this can be updated by modifying the IsUnixLike() method.
2) Eliminating the assumption that a backslash is the path separator, which is true on Windows but not on macOS or on typical Unices. Instead, Path.Join() is used consistently to avoid this assumption. Note that this change should benefit Mac users as well.
There are two main changes here:
1) Modifying GetAppDataDirectory() to return a reasonable value for Unix-like systems. Following Cura's behavior, this directory is either
$XDG_DATA_HOME
, if it exists, or$HOME/.local/share
otherwise. For now, only Linux and FreeBSD are supported, since this is what the .NET runtime supports, but this can be updated by modifying theIsUnixLike()
method.2) Eliminating the assumption that a backslash is the path separator, which is true on Windows but not on macOS or on typical Unices. Instead,
Path.Join()
is used consistently to avoid this assumption. Note that this change should benefit Mac users as well.