phnxdrgn536 / FLSun-v400

Repository of helpful files for V400 printer
Creative Commons Zero v1.0 Universal
72 stars 15 forks source link

Allow loader to be used on traditional Unix-like systems #27

Closed jjramsey closed 1 year ago

jjramsey commented 1 year ago

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 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.