Skip to content

Commit

Permalink
Use value of env ESDE_APPDATA_DIR if present (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gemba authored Jun 25, 2024
1 parent ceb94fc commit 2fac310
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/FRONTENDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ media files into the `downloaded_media` folder (e.g.
`~/ES-DE/downloaded_media/<PLATFORM>/screenshots/` for screenshots) from where
ES-DE will pick them up. Note that ES-DE does not support textures currently.

!!! tip

You may override the default storage folder of ES-DE (`/home/<USER>/ES-DE`)
on a non-Windows build by setting the environment variable `ESDE_APPDATA_DIR`
to a different folder as documented in the ES-DE documentation [here](https://gitlab.com/es-de/emulationstation-de/-/blob/v3.0.2/INSTALL.md#changing-the-application-data-directory).

All the gory details of ES-DE's gamelist file format you can find in the section
"Gamelist Reference"
[here](https://gitlab.com/es-de/emulationstation-de/-/blob/master/INSTALL.md?ref_type=heads#gamelistxml).
Expand Down
9 changes: 9 additions & 0 deletions src/esde.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,21 @@
#include "gameentry.h"

#include <QDir>
#include <QProcessEnvironment>
#include <QStringBuilder>
#include <QStringList>

Esde::Esde() {}

inline const QString baseFolder() {
#if !(defined Q_OS_WIN || defined Q_OS_ANDROID)
// https://gitlab.com/es-de/emulationstation-de/-/blob/v3.0.2/INSTALL.md#changing-the-application-data-directory
QString appdata =
QProcessEnvironment::systemEnvironment().value("ESDE_APPDATA_DIR", "");
if (!appdata.isEmpty()) {
return appdata;
}
#endif
return QString(QDir::homePath() % "/ES-DE");
}

Expand Down

0 comments on commit 2fac310

Please sign in to comment.