begin using GetUserDirectory()
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1448 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
d5c9afd449
commit
f0758fc3e2
|
@ -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)
|
||||
|
|
|
@ -48,7 +48,7 @@ bool CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode)
|
|||
{
|
||||
// clear tmp folder
|
||||
{
|
||||
std::string WiiTempFolder(FULL_WII_USER_DIR "tmp");
|
||||
std::string WiiTempFolder = File::GetUserDirectory() + FULL_WII_USER_DIR + std::string("tmp");
|
||||
File::DeleteDirRecursively(WiiTempFolder.c_str());
|
||||
File::CreateDir(WiiTempFolder.c_str());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue