Qt: Fix incorrect directories on Linux

This commit is contained in:
Connor McLaughlin 2022-07-23 00:01:47 +10:00
parent 23ea7b92bc
commit c90824f8e9
3 changed files with 6 additions and 10 deletions

View file

@ -201,8 +201,5 @@
</item>
</layout>
</widget>
<resources>
<include location="../../p2-qt-rebase/pcsx2-qt/resources/resources.qrc"/>
</resources>
<connections/>
</ui>

View file

@ -275,7 +275,7 @@ void QtHost::SetDataDirectory()
}
#if defined(_WIN32)
// On Windows, use My Documents\PCSX2 to match old installs.
// On Windows, use My Documents\DuckStation.
PWSTR documents_directory;
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_Documents, 0, NULL, &documents_directory)))
{
@ -284,16 +284,15 @@ void QtHost::SetDataDirectory()
CoTaskMemFree(documents_directory);
}
#elif defined(__linux__)
// Use $XDG_CONFIG_HOME/PCSX2 if it exists.
// Use $XDG_CONFIG_HOME/duckstation if it exists.
const char* xdg_config_home = getenv("XDG_CONFIG_HOME");
if (xdg_config_home && Path::IsAbsolute(xdg_config_home))
{
EmuFolders::DataRoot = Path::Combine(xdg_config_home, "PCSX2");
EmuFolders::DataRoot = Path::Combine(xdg_config_home, "duckstation");
}
else
{
// Use ~/PCSX2 for non-XDG, and ~/.config/PCSX2 for XDG.
// Maybe we should drop the former when Qt goes live.
// Use ~/.local/share/duckstation otherwise.
const char* home_dir = getenv("HOME");
if (home_dir)
{

View file

@ -154,7 +154,7 @@ void SettingsDialog::addPages()
addWidget(
m_folder_settings = new FolderSettingsWidget(this, m_ui.settingsContainer), tr("Folders"),
QStringLiteral("folder-settings-line"),
tr("<strong>Folder Settings</strong><hr>These options control where PCSX2 will save runtime data files."));
tr("<strong>Folder Settings</strong><hr>These options control where DuckStation will save runtime data files."));
}
addWidget(m_advanced_settings = new AdvancedSettingsWidget(this, m_ui.settingsContainer), tr("Advanced"),