diff options
| author | bushing <bushing@gmail.com> | 2008-12-08 11:34:26 +0000 |
|---|---|---|
| committer | bushing <bushing@gmail.com> | 2008-12-08 11:34:26 +0000 |
| commit | f0758fc3e234dcc1bff3e8c355019aff4ad08178 (patch) | |
| tree | 0499104ced9840cdb64caa88e333c428add9bc52 /Source/Core/Common/Src/FileUtil.cpp | |
| parent | d5c9afd449fba640138736379e3c8ae36c0d7f37 (diff) | |
begin using GetUserDirectory()
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1448 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
| -rw-r--r-- | Source/Core/Common/Src/FileUtil.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 99888a99ab..86ae07fa51 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -293,19 +293,24 @@ bool Copy(const char *srcFilename, const char *destFilename) std::string GetUserDirectory() { -#ifdef _WIN32 char path[MAX_PATH]; +#ifdef _WIN32 if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path))) { return std::string(path); } return std::string(""); #else - char *dir = getenv("HOME"); + char *homedir = getenv("HOME"); if (!dir) return std::string(""); - return dir; +#ifdef __APPLE__ + snprintf(path, sizeof(path), "%s/Library/Application Support/Dolphin"); +#else + snprintf(path, sizeof(path), "%s/.dolphin"); // XXX changeme as appropriate +#endif #endif + return std::string(path); } u64 GetSize(const char *filename) |
