mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 00:38:58 +00:00
Fix up import destination indicator
This commit is contained in:
@@ -694,7 +694,8 @@ std::string GetSysDirectory() {
|
||||
|
||||
namespace {
|
||||
std::unordered_map<UserPath, std::string> g_paths;
|
||||
}
|
||||
bool g_portable_user_directory = false;
|
||||
} // namespace
|
||||
|
||||
void SetUserPath(const std::string& path) {
|
||||
if (!g_paths.empty()) {
|
||||
@@ -715,6 +716,7 @@ void SetUserPath(const std::string& path) {
|
||||
user_path = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP;
|
||||
} else {
|
||||
LOG_INFO(Common_Filesystem, "Using the local user directory");
|
||||
g_portable_user_directory = true;
|
||||
}
|
||||
|
||||
g_paths.emplace(UserPath::ConfigDir, user_path + CONFIG_DIR DIR_SEP);
|
||||
@@ -726,6 +728,9 @@ void SetUserPath(const std::string& path) {
|
||||
user_path = ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP;
|
||||
g_paths.emplace(UserPath::ConfigDir, user_path + CONFIG_DIR DIR_SEP);
|
||||
g_paths.emplace(UserPath::CacheDir, user_path + CACHE_DIR DIR_SEP);
|
||||
|
||||
LOG_INFO(Common_Filesystem, "Using the local user directory");
|
||||
g_portable_user_directory = true;
|
||||
} else {
|
||||
std::string data_dir = GetUserDirectory("XDG_DATA_HOME");
|
||||
std::string config_dir = GetUserDirectory("XDG_CONFIG_HOME");
|
||||
@@ -753,6 +758,10 @@ const std::string& GetUserPath(UserPath path) {
|
||||
return g_paths[path];
|
||||
}
|
||||
|
||||
bool IsPortableUserDirectory() {
|
||||
return g_portable_user_directory;
|
||||
}
|
||||
|
||||
std::size_t WriteStringToFile(bool text_file, const std::string& filename, std::string_view str) {
|
||||
return IOFile(filename, text_file ? "w" : "wb").WriteString(str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user