mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-18 18:09:18 +02:00
refactor: extract user_config_path() helper
Consolidates platform-specific config-directory logic (APPDATA on Windows,
~/Library/Application Support on macOS, ~/.config on Linux) into a single
user_config_path(filename) function in utilities/utilities.{cpp,h}, removing
copy-pasted #ifdef blocks from application.cpp, editor/editorSettings.cpp,
input/{keyboard,gamepad,drivermouse,uart}input.cpp.
This commit is contained in:
@@ -25,6 +25,10 @@ template <typename T> constexpr T sq(T v)
|
||||
return v * v;
|
||||
}
|
||||
|
||||
// returns the per-user config path for `filename` (platform-specific dir),
|
||||
// or an empty path if the home/appdata env var is unavailable
|
||||
std::filesystem::path user_config_path(const std::string &filename);
|
||||
|
||||
// TODO: Shouldn't this be in globals?
|
||||
namespace paths
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user