From ed3695f7049f3506c7521fcbcb8cdb99e089f41a Mon Sep 17 00:00:00 2001 From: BearOso Date: Tue, 18 Jun 2024 15:35:05 -0500 Subject: [PATCH] Gtk: Fix config directory order. Search for XDG_CONFIG_HOME. If that exists, use $XDG_CONFIG_HOME/snes9x, otherwise use $HOME/.config/snes9x. Remove broken legacy check. --- gtk/src/gtk_config.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/gtk/src/gtk_config.cpp b/gtk/src/gtk_config.cpp index 1f03795d..21b9a367 100644 --- a/gtk/src/gtk_config.cpp +++ b/gtk/src/gtk_config.cpp @@ -33,22 +33,18 @@ std::string get_config_dir() return std::string{".snes9x"}; } - fs::path config = env_home; - fs::path legacy = config; - + fs::path config; // If XDG_CONFIG_HOME is set, use that, otherwise guess default - if (!env_xdg_config_home) - { - config /= ".config/snes9x"; - legacy /= ".snes9x"; - } - else + if (env_xdg_config_home) { config = env_xdg_config_home; config /= "snes9x"; } - if (fs::exists(legacy) && !fs::exists(config)) - return legacy; + else + { + config = env_home; + config /= ".config/snes9x"; + } return config; }