Fixed incorrect applications directory path while using Flatpak build

This commit is contained in:
OpenSauce04
2024-08-13 20:25:25 +01:00
parent 6d37ef8b27
commit a3a6aed9be
6 changed files with 35 additions and 9 deletions

View File

@@ -1,7 +1,10 @@
// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
// Copyright Citra Emulator Project / Lime3DS Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
// Copyright Dolphin Emulator Project
// Licensed under GPLv2 or any later version
#include <array>
#include <fstream>
#include <limits>
@@ -707,8 +710,8 @@ std::string AppDataRoamingDirectory() {
/**
* @return The users home directory on POSIX systems
*/
static const std::string& GetHomeDirectory() {
static std::string home_path;
const std::string GetHomeDirectory() {
std::string home_path;
if (home_path.empty()) {
const char* envvar = getenv("HOME");
if (envvar) {

View File

@@ -1,7 +1,10 @@
// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project
// Copyright Citra Emulator Project / Lime3DS Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
// Copyright Dolphin Emulator Project
// Licensed under GPLv2 or any later version
#pragma once
#include <array>
@@ -204,6 +207,7 @@ void UpdateUserPath(UserPath path, const std::string& filename);
[[nodiscard]] const std::string& GetExeDirectory();
[[nodiscard]] std::string AppDataRoamingDirectory();
#else
[[nodiscard]] const std::string GetHomeDirectory();
[[nodiscard]] const std::string GetUserDirectory(const std::string& envvar);
#endif