mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
Fix user directories at times doing stupid things.
With my previous changes Dolphin would fail to create the user directory if it didn't exist, and would dump all the configuration options in to the cwdir. This was a bit more complicated to fix in a clean fashion, so I took to moving around code concerning user directories. Instead of having GetUserPath serve a dual purpose of both getting and setting our user directories, break out to a new SetUserPath function. GetUserPath will know only get the configured user path. SetUserPath will set our user paths and setup the internal user path state. This ending up being a lot cleaner overall, which is nice. Also less mind bending when attempting to read the code. So now we won't dump all of our configuration in to the cwdir if ~/.dolphin-emu isn't found. Fixes issue 8371.
This commit is contained in:
@ -126,9 +126,13 @@ bool SetCurrentDir(const std::string &directory);
|
||||
// Get a filename that can hopefully be atomically renamed to the given path.
|
||||
std::string GetTempFilenameForAtomicWrite(const std::string &path);
|
||||
|
||||
// Returns a pointer to a string with a Dolphin data dir in the user's home
|
||||
// directory. To be used in "multi-user" mode (that is, installed).
|
||||
const std::string& GetUserPath(const unsigned int DirIDX, const std::string &newPath="");
|
||||
// Gets a set user directory path
|
||||
// Don't call prior to setting the base user directory
|
||||
const std::string& GetUserPath(unsigned int dir_index);
|
||||
|
||||
// Sets a user directory path
|
||||
// Rebuilds internal directory structure to compensate for the new directory
|
||||
void SetUserPath(unsigned int dir_index, const std::string& path);
|
||||
|
||||
// probably doesn't belong here
|
||||
std::string GetThemeDir(const std::string& theme_name);
|
||||
|
Reference in New Issue
Block a user