diff --git a/client/SDL/common/sdl_prefs.cpp b/client/SDL/common/sdl_prefs.cpp index 6f72b6e17..fc27e1d85 100644 --- a/client/SDL/common/sdl_prefs.cpp +++ b/client/SDL/common/sdl_prefs.cpp @@ -31,6 +31,7 @@ namespace fs = std::experimental::filesystem; #endif #include "sdl_prefs.hpp" +#include "sdl_common_utils.hpp" #include #include @@ -218,21 +219,10 @@ SdlPref::SdlPref(std::string file) { } -std::string SdlPref::get_pref_dir(bool systemConfigOnly) -{ - using CStringPtr = std::unique_ptr; - CStringPtr path(freerdp_GetConfigFilePath(systemConfigOnly, ""), free); - if (!path) - return {}; - - fs::path config{ path.get() }; - return config.string(); -} - std::string SdlPref::get_default_file(bool systemConfigOnly) { - fs::path config{ SdlPref::get_pref_dir(systemConfigOnly) }; - config /= "sdl-freerdp.json"; + CStringPtr name(freerdp_GetConfigFilePath(systemConfigOnly, "sdl-freerdp.json"), free); + fs::path config{ name.get() }; return config.string(); } diff --git a/client/SDL/common/sdl_prefs.hpp b/client/SDL/common/sdl_prefs.hpp index aeb9b615d..63ea0bdd6 100644 --- a/client/SDL/common/sdl_prefs.hpp +++ b/client/SDL/common/sdl_prefs.hpp @@ -63,7 +63,6 @@ class SdlPref [[nodiscard]] bool is_user_config_enabled() const; - static std::string get_pref_dir(bool systemConfigOnly); static std::string get_default_file(bool systemConfigOnly); static std::string item_to_str(WINPR_JSON* item, const std::string& fallback = ""); };