Menu

#31 use ~/.config/ on Linux and APPDATA on Windows

future
wont-fix
nobody
None
1
2015-08-01
2015-05-22
qubodup
No

Currently, the trigger config files is a hidden file in ~/ on Linux and C:\users\username.trigger on Windows. The method on Linux is outdated and the method on Windows works but is not appropriate for Windows.

This should be investigated and fixed.

From https://sourceforge.net/p/trigger-rally/discussion/527953/thread/e84721b6/ :

the modern way for Linux apps would be to use ~/.config/trigger/ as the config dir and Windows has a completely different method which I don't know much about (System.getenv("APPDATA") apparently: http://stackoverflow.com/questions/6561172/find-directory-for-application-data-on-linux-and-macintosh )

Discussion

  • Andrei

    Andrei - 2015-08-01

    This is too much hassle, on Windows at least. To get the %APPDATA% folder one would have to use either SHGetKnownFolderPath which returns a Unicode string (which would have to be converted to ANSI), or a deprecated function such as SHGetFolderPath.

    It could be fixed for Linux by changing main.cpp, main() function so:

    // MainApp *game = new MainApp("Trigger Rally", ".trigger-rally");
    MainApp *game = new MainApp("Trigger Rally", ".config/trigger-rally");
    

    However, I will not commit code that I am not in position to test. In addition, these "fixes" seem more like hacks, because PhysFS is already used for getting the user directory via PHYSFS_getUserDir. So if there is no clean way to get the configuration directory and the current method works as-is, we should leave it alone.

     
  • Andrei

    Andrei - 2015-08-01
    • status: open --> wont-fix
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.