summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Src/FileUtil.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2010-05-12 04:26:32 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2010-05-12 04:26:32 +0000
commite7099251ce9ffb7fdb7eb8bdab62c55224e8f195 (patch)
tree1da94e808134877493d5f6c39ffe2d173eec4c09 /Source/Core/Common/Src/FileUtil.cpp
parentbbc9e8cb7165d781dbf965ac8678eef819963290 (diff)
OSX fix Dolphin not actually using the Application Support path.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5445 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/Common/Src/FileUtil.cpp')
-rw-r--r--Source/Core/Common/Src/FileUtil.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp
index b162bab34c..ae68b6b0c5 100644
--- a/Source/Core/Common/Src/FileUtil.cpp
+++ b/Source/Core/Common/Src/FileUtil.cpp
@@ -488,10 +488,10 @@ bool DeleteDirRecursively(const char *directory)
return true;
}
-#ifdef __linux__
//Create directory and copy contents (does not overwrite existing files)
void CopyDir(const char *source_path, const char *dest_path)
{
+#ifndef _WIN32
if (!strcmp(source_path, dest_path)) return;
if (!File::Exists(source_path)) return;
if (!File::Exists(dest_path)) File::CreateFullPath(dest_path);
@@ -525,8 +525,8 @@ void CopyDir(const char *source_path, const char *dest_path)
else if (!File::Exists(dest)) File::Copy(source, dest);
}
closedir(dirp);
-}
#endif
+}
// Returns the current directory
std::string GetCurrentDir()
@@ -553,7 +553,6 @@ bool SetCurrentDir(const char *_rDirectory)
#if defined(__APPLE__)
std::string GetBundleDirectory()
{
- // Plugin path will be Dolphin.app/Contents/PlugIns
CFURLRef BundleRef;
char AppBundlePath[MAXPATHLEN];
// Get the main bundle for the app
@@ -574,7 +573,6 @@ std::string GetBundleDirectory()
}
#endif
-// Returns the path to where the plugins are
std::string GetPluginsDirectory()
{
std::string pluginsDir;
@@ -596,7 +594,6 @@ std::string GetPluginsDirectory()
return pluginsDir;
}
-// Returns the path to where the sys file are
std::string GetSysDirectory()
{
std::string sysDir;
@@ -657,18 +654,13 @@ const char *GetUserPath(int DirIDX)
#ifdef _WIN32
// Keep the directory setup the way it was on windows
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
- //char homedir[MAX_PATH];
- //if (!SUCCEEDED(SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, path)))
- // return NULL;
-#else
+#elif defined (__linux__)
if (File::Exists(ROOT_DIR DIR_SEP USERDATA_DIR))
snprintf(UserDir, sizeof(UserDir), ROOT_DIR DIR_SEP USERDATA_DIR DIR_SEP);
else
- {
- char *homedir = getenv("HOME");
- if (homedir)
- snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, homedir);
- }
+ snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME"));
+#else
+ snprintf(UserDir, sizeof(UserDir), "%s" DIR_SEP DOLPHIN_DATA_DIR DIR_SEP, getenv("HOME"));
#endif
INFO_LOG(COMMON, "GetUserPath: Setting user directory to %s:", UserDir);