From: Thomas Debesse Date: Sat, 24 Nov 2018 22:06:59 +0000 (+0100) Subject: radiant: check Linux prefix against XDG_DATA_HOME before HOME X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=66044ddab695842249eb61a4b395165d2a5d4ec8;p=xonotic%2Fnetradiant.git radiant: check Linux prefix against XDG_DATA_HOME before HOME --- diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index f43268a5..225a7d5e 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -256,9 +256,17 @@ void HomePaths_Realise(){ #if (GDEF_OS_POSIX && !GDEF_OS_MACOS) path.clear(); - path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/"; - g_qeglobals.m_userEnginePath = path.c_str(); - break; + path << DirectoryCleaned( g_get_user_data_dir() ) << ( prefix + 1 ) << "/"; + if ( file_exists( path.c_str() ) && file_is_directory( path.c_str() ) ) { + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } + else { + path.clear(); + path << DirectoryCleaned( g_get_home_dir() ) << prefix << "/"; + g_qeglobals.m_userEnginePath = path.c_str(); + break; + } #endif }