From bed6b24eeb038fe7d0e0e26451b7b3cdf99310dc Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Wed, 30 Jun 2021 17:11:25 +0200 Subject: [PATCH] Added support for using the %ESPATH% and %ROMPATH% variables for the custom slideshow path. --- es-app/src/SystemScreensaver.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es-app/src/SystemScreensaver.cpp b/es-app/src/SystemScreensaver.cpp index 3be04bcdc..85ffc624c 100644 --- a/es-app/src/SystemScreensaver.cpp +++ b/es-app/src/SystemScreensaver.cpp @@ -495,6 +495,11 @@ void SystemScreensaver::generateCustomImageList() std::string imageDir = Utils::FileSystem::expandHomePath( Settings::getInstance()->getString("ScreensaverSlideshowImageDir")); + // This makes it possible to set the custom image directory relative to the ES-DE binary + // directory or the ROM directory. + imageDir = Utils::String::replace(imageDir, "%ESPATH%", Utils::FileSystem::getExePath()); + imageDir = Utils::String::replace(imageDir, "%ROMPATH%", FileData::getROMDirectory()); + if (imageDir != "" && Utils::FileSystem::isDirectory(imageDir)) { std::string imageFilter = ".jpg, .JPG, .png, .PNG"; Utils::FileSystem::stringList dirContent = Utils::FileSystem::getDirContent(