From f432d6038e353f98cbe0fa522bd9d6034027246e Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 31 Mar 2013 19:10:21 -0400 Subject: Fix some typos and correct some capitalizations in the log messages. Makes the logging look more orderly and less spammy when spitting out things. --- Source/Core/Common/Src/FileUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index e8a7540c0a..6d2e82a261 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -723,7 +723,7 @@ 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)) { -- cgit v1.2.3 From 58159a1693ebb9b33b6e1b97a83a2f58f0046623 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 1 Apr 2013 00:10:54 -0400 Subject: Some more logging typos and clarifications. Missed these in my last commit. This commit mainly elaborates on some messages a little more. Also fixes some typos that slipped through the last commit. A large change in text can be seen in EXI_DeviceMemoryCard.cpp. I added more info as to why a write to a memory card may fail. (This actually was a reason I was unable to write to a memcard recently). Elaborations can be seen in WGL.cpp I did change some comments in some files that I was correcting logging messages in, however this is only if I spot a typo or if an abbreviation is lower-cased. Even in that case, the amount of changes done to comments is very minimal. --- Source/Core/Common/Src/FileUtil.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 6d2e82a261..29b7bb5403 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -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; @@ -727,7 +727,7 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) 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 -- cgit v1.2.3 From 69779a43214289b8a022b27f2444d8a44b897984 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 1 Apr 2013 23:17:15 -0500 Subject: Fix loading of "themes" with non-ascii character names. Fixed issue 6189. Why did GetUserPath return a non-const ref to string..? --- Source/Core/Common/Src/FileUtil.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 29b7bb5403..e267c8a662 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -19,6 +19,7 @@ #include "CommonPaths.h" #include "FileUtil.h" #include "StringUtil.h" +#include "ConfigManager.h" #ifdef _WIN32 #include @@ -669,7 +670,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]; @@ -742,6 +743,20 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath) return paths[DirIDX]; } +std::string GetThemeDir() +{ + std::string theme = SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/"; + std::string dir = File::GetUserPath(D_THEMES_IDX) + theme; + +#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; +#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()); -- cgit v1.2.3 From c65473d9d35b2dee02e4f444b0d904c3c74ab5fa Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Mon, 1 Apr 2013 23:30:05 -0500 Subject: Probably a sloppy buildfix. --- Source/Core/Common/Src/FileUtil.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index e267c8a662..12be1f1a21 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -19,7 +19,7 @@ #include "CommonPaths.h" #include "FileUtil.h" #include "StringUtil.h" -#include "ConfigManager.h" +#include "../../Core/Src/ConfigManager.h" #ifdef _WIN32 #include -- cgit v1.2.3 From d951c4c374499da5b9143a6df2194ac74e37b159 Mon Sep 17 00:00:00 2001 From: Jordan Woyak Date: Tue, 2 Apr 2013 13:04:40 -0500 Subject: real buildfix --- Source/Core/Common/Src/FileUtil.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Source/Core/Common/Src/FileUtil.cpp') diff --git a/Source/Core/Common/Src/FileUtil.cpp b/Source/Core/Common/Src/FileUtil.cpp index 12be1f1a21..ab58cb3f98 100644 --- a/Source/Core/Common/Src/FileUtil.cpp +++ b/Source/Core/Common/Src/FileUtil.cpp @@ -19,7 +19,6 @@ #include "CommonPaths.h" #include "FileUtil.h" #include "StringUtil.h" -#include "../../Core/Src/ConfigManager.h" #ifdef _WIN32 #include @@ -743,15 +742,14 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string &new return paths[DirIDX]; } -std::string GetThemeDir() +std::string GetThemeDir(const std::string& theme_name) { - std::string theme = SConfig::GetInstance().m_LocalCoreStartupParameter.theme_name + "/"; - std::string dir = File::GetUserPath(D_THEMES_IDX) + theme; + 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; + dir = SHARED_USER_DIR THEMES_DIR "/" + theme_name + "/"; #endif return dir; -- cgit v1.2.3