From b7234db96d3ea284c7fb5ae8ab131a8ba5b5bcb5 Mon Sep 17 00:00:00 2001 From: Ivan Gagis Date: Wed, 25 Dec 2024 17:01:31 +0200 Subject: [PATCH] stuff --- src/ruisapp/glue/sdl/glue.cxx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ruisapp/glue/sdl/glue.cxx b/src/ruisapp/glue/sdl/glue.cxx index dc9f501..3a08d98 100644 --- a/src/ruisapp/glue/sdl/glue.cxx +++ b/src/ruisapp/glue/sdl/glue.cxx @@ -457,12 +457,16 @@ class window_wrapper : public utki::destructable namespace { ruisapp::application::directories get_application_directories(std::string_view app_name) { + char* base_dir = SDL_GetPrefPath("", std::string(app_name).c_str()); + utki::scope_exit base_dir_scope_exit([&]() { + SDL_free(base_dir); + }); + ruisapp::application::directories dirs; - // TODO: - dirs.cache = utki::cat(".cache/"sv, app_name); - dirs.config = utki::cat(".config/"sv, app_name); - dirs.state = utki::cat(".local/state/"sv, app_name); + dirs.cache = utki::cat(base_dir, "cache/"sv); + dirs.config = utki::cat(base_dir, "config/"sv); + dirs.state = utki::cat(base_dir, "state/"sv); // std::cout << "cache dir = " << dirs.cache << std::endl; // std::cout << "config dir = " << dirs.config << std::endl;