mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
begin using GetUserDirectory()
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1448 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -293,19 +293,24 @@ bool Copy(const char *srcFilename, const char *destFilename)
|
|||||||
|
|
||||||
std::string GetUserDirectory()
|
std::string GetUserDirectory()
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
|
||||||
char path[MAX_PATH];
|
char path[MAX_PATH];
|
||||||
|
#ifdef _WIN32
|
||||||
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
|
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, path)))
|
||||||
{
|
{
|
||||||
return std::string(path);
|
return std::string(path);
|
||||||
}
|
}
|
||||||
return std::string("");
|
return std::string("");
|
||||||
#else
|
#else
|
||||||
char *dir = getenv("HOME");
|
char *homedir = getenv("HOME");
|
||||||
if (!dir)
|
if (!dir)
|
||||||
return std::string("");
|
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
|
||||||
|
#endif
|
||||||
|
return std::string(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
u64 GetSize(const char *filename)
|
u64 GetSize(const char *filename)
|
||||||
|
@ -48,7 +48,7 @@ bool CWII_IPC_HLE_Device_fs::Open(u32 _CommandAddress, u32 _Mode)
|
|||||||
{
|
{
|
||||||
// clear tmp folder
|
// 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::DeleteDirRecursively(WiiTempFolder.c_str());
|
||||||
File::CreateDir(WiiTempFolder.c_str());
|
File::CreateDir(WiiTempFolder.c_str());
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user