From 67488467c3071e968bfc8bc75cd5bd8ce8fe807f Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 20 Aug 2022 11:30:15 +0200 Subject: [PATCH] (Linux) The data installation directory is now excluded for themes and resources when built as an AppImage. --- es-core/src/ThemeData.cpp | 10 +++++++--- es-core/src/resources/ResourceManager.cpp | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/es-core/src/ThemeData.cpp b/es-core/src/ThemeData.cpp index c753ac970..f9c28dbe1 100644 --- a/es-core/src/ThemeData.cpp +++ b/es-core/src/ThemeData.cpp @@ -545,15 +545,19 @@ void ThemeData::populateThemeSets() // directory (Unix only) and last under the ES-DE binary directory. #if defined(__unix__) || defined(__APPLE__) - static const size_t pathCount = 3; +#if defined(APPIMAGE_BUILD) + static const size_t pathCount {2}; #else - static const size_t pathCount = 2; + static const size_t pathCount {3}; +#endif +#else + static const size_t pathCount {2}; #endif std::string paths[pathCount] = { Utils::FileSystem::getExePath() + "/themes", #if defined(__APPLE__) Utils::FileSystem::getExePath() + "/../Resources/themes", -#elif defined(__unix__) +#elif defined(__unix__) && !defined(APPIMAGE_BUILD) Utils::FileSystem::getProgramDataPath() + "/themes", #endif Utils::FileSystem::getHomePath() + "/.emulationstation/themes" diff --git a/es-core/src/resources/ResourceManager.cpp b/es-core/src/resources/ResourceManager.cpp index 148cf5a94..93a41be9e 100644 --- a/es-core/src/resources/ResourceManager.cpp +++ b/es-core/src/resources/ResourceManager.cpp @@ -44,7 +44,7 @@ std::string ResourceManager::getResourcePath(const std::string& path, bool termi return applePackagePath; } -#elif defined(__unix__) +#elif defined(__unix__) && !defined(APPIMAGE_BUILD) // Check under the data installation directory (Unix only). std::string testDataPath; @@ -71,7 +71,7 @@ std::string ResourceManager::getResourcePath(const std::string& path, bool termi LOG(LogError) << testHome; #if defined(__APPLE__) LOG(LogError) << applePackagePath; -#elif defined(__unix__) +#elif defined(__unix__) && !defined(APPIMAGE_BUILD) LOG(LogError) << testDataPath; #endif LOG(LogError) << testExePath;