mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 15:45:38 +00:00
Added support for using the %ESPATH% variable in the media directory setting.
This commit is contained in:
parent
1eaa9ce2d7
commit
4ba2e67e9f
|
@ -180,9 +180,8 @@ const std::string FileData::getROMDirectory()
|
|||
#endif
|
||||
}
|
||||
|
||||
// If %ESPATH% is used for the ROM path configuration, then expand it to the executable
|
||||
// directory of ES. This is useful for a portable emulator installation, for instance on
|
||||
// a USB memory stick.
|
||||
// If %ESPATH% is used for the ROM path configuration, then expand it to the binary
|
||||
// directory of ES-DE.
|
||||
romDirPath = Utils::String::replace(romDirPath, "%ESPATH%", Utils::FileSystem::getExePath());
|
||||
|
||||
return romDirPath;
|
||||
|
@ -200,7 +199,11 @@ const std::string FileData::getMediaDirectory()
|
|||
mediaDirPath = mediaDirSetting;
|
||||
// Expand home path if ~ is used.
|
||||
mediaDirPath = Utils::FileSystem::expandHomePath(mediaDirPath);
|
||||
// Expand home symbol if the path starts with ~
|
||||
|
||||
// If %ESPATH% is used for the media directory configuration, then expand it to the
|
||||
// binary directory of ES-DE.
|
||||
mediaDirPath = Utils::String::replace(
|
||||
mediaDirPath, "%ESPATH%", Utils::FileSystem::getExePath());
|
||||
|
||||
if (mediaDirPath.back() != '/')
|
||||
mediaDirPath = mediaDirPath + "/";
|
||||
|
|
Loading…
Reference in a new issue