Merge branch 'master' into wii-network

Conflicts:
	Source/Core/Core/CMakeLists.txt
This commit is contained in:
Matthew Parlane
2013-04-11 19:55:36 +12:00
369 changed files with 21804 additions and 18869 deletions

View File

@ -124,7 +124,7 @@ bool Delete(const std::string &filename)
// being there, not the actual delete.
if (!Exists(filename))
{
WARN_LOG(COMMON, "Delete: %s does not exists", filename.c_str());
WARN_LOG(COMMON, "Delete: %s does not exist", filename.c_str());
return true;
}
@ -216,7 +216,7 @@ bool CreateFullPath(const std::string &fullPath)
panicCounter--;
if (panicCounter <= 0)
{
ERROR_LOG(COMMON, "CreateFullPath: directory structure too deep");
ERROR_LOG(COMMON, "CreateFullPath: directory structure is too deep");
return false;
}
position++;
@ -324,7 +324,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
goto bail;
}
}
// close flushs
// close files
fclose(input);
fclose(output);
return true;
@ -669,7 +669,7 @@ std::string GetSysDirectory()
// Returns a string with a Dolphin data dir or file in the user's home
// directory. To be used in "multi-user" mode (that is, installed).
std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
const std::string& GetUserPath(const unsigned int DirIDX, const std::string &newPath)
{
static std::string paths[NUM_PATH_INDICES];
@ -724,11 +724,11 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
if (!newPath.empty())
{
if(DirIDX != D_WIIROOT_IDX)
PanicAlert("trying to change user path other than wii root");
PanicAlert("Trying to change user path other than Wii root");
if (!File::IsDirectory(newPath))
{
WARN_LOG(COMMON, "Invalid path specified %s, wii user path will be set to default", newPath.c_str());
WARN_LOG(COMMON, "Invalid path specified %s, Wii user path will be set to default", newPath.c_str());
paths[D_WIIROOT_IDX] = paths[D_USER_IDX] + WII_USER_DIR;
}
else
@ -744,6 +744,19 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
return paths[DirIDX];
}
std::string GetThemeDir(const std::string& theme_name)
{
std::string dir = File::GetUserPath(D_THEMES_IDX) + theme_name + "/";
#if !defined(_WIN32)
// If theme does not exist in user's dir load from shared directory
if (!File::Exists(dir))
dir = SHARED_USER_DIR THEMES_DIR "/" + theme_name + "/";
#endif
return dir;
}
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
{
return File::IOFile(filename, text_file ? "w" : "wb").WriteBytes(str.data(), str.size());