From f34e6edb7738d0e8ace5cfc9d1fbff5607e749b9 Mon Sep 17 00:00:00 2001 From: WrinklyNinja Date: Wed, 27 Aug 2014 00:34:46 +0100 Subject: [PATCH] Death to trailing whitespace! Sorry about that... --- src/backend/game.h | 6 +++--- src/backend/git.cpp | 6 ++---- src/backend/metadata.cpp | 1 - src/backend/metadata.h | 2 +- src/gui/app.cpp | 7 ++++--- src/gui/app.h | 4 ++-- src/gui/handler.cpp | 14 +++++++------- src/gui/handler.h | 10 +++++----- src/gui/main_win.cpp | 2 +- 9 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/backend/game.h b/src/backend/game.h index e303002c..9d282fcf 100644 --- a/src/backend/game.h +++ b/src/backend/game.h @@ -41,7 +41,7 @@ #include namespace loot { - + class Game; /* Each Game object should store the config details specific to that game. @@ -78,7 +78,7 @@ namespace loot { bool Load(Game& game, const unsigned int language); //Handles update with load fallback. bool Update(Game& game, const unsigned int language); - + std::string GetRevision(const boost::filesystem::path& path); std::string GetDate(const boost::filesystem::path& path); @@ -96,7 +96,7 @@ namespace loot { Game(const unsigned int baseGameCode, const std::string& lootFolder = ""); Game& SetDetails(const std::string& name, const std::string& masterFile, - const std::string& repositoryURL, const std::string& repositoryBranch, + const std::string& repositoryURL, const std::string& repositoryBranch, const std::string& path, const std::string& registry); Game& SetPath(const std::string& path); //Used by API. Game& Init(); diff --git a/src/backend/git.cpp b/src/backend/git.cpp index 4e2af669..3adc3c1b 100644 --- a/src/backend/git.cpp +++ b/src/backend/git.cpp @@ -94,7 +94,6 @@ namespace loot { git_diff * diff; git_buf buf; - std::string ui_message; }; @@ -203,7 +202,8 @@ namespace loot { if (!fs::is_empty(repo_path)) { // Clear any read-only flags first. FixRepoPermissions(repo_path); - // Now, libgit2 doesn't support cloning into non-empty folders. Rename the folder + // Now, libgit2 doesn't support cloning into non-empty folders. Rename the folder + // temporarily, and move its contents back in afterwards, skipping any that then conflict. BOOST_LOG_TRIVIAL(trace) << "Repo path not empty, renaming folder."; // If the temp path already exists, it needs to be deleted. @@ -294,7 +294,6 @@ namespace loot { const git_oid * commit_id = git_object_id(git.obj); BOOST_LOG_TRIVIAL(trace) << "Creating the new branch."; - // Create a branch. git.call(git_commit_lookup(&git.commit, git.repo, commit_id)); git.call(git_branch_create(&git.ref, git.repo, repo_branch.c_str(), git.commit, 0, git.sig, NULL)); @@ -303,7 +302,6 @@ namespace loot { git.call(git_branch_set_upstream(git.ref, (string("origin/") + repo_branch).c_str())); BOOST_LOG_TRIVIAL(trace) << "Setting the upstream for the new branch."; - // Free tree and commit pointers. Reference pointer is still used below. git_object_free(git.obj); git_commit_free(git.commit); diff --git a/src/backend/metadata.cpp b/src/backend/metadata.cpp index 71bbf562..1a0a816f 100644 --- a/src/backend/metadata.cpp +++ b/src/backend/metadata.cpp @@ -460,7 +460,6 @@ namespace loot { p.Priority(0); p.SetPriorityExplicit(false); } - //Compare this plugin against the given plugin. set files = plugin.LoadAfter(); diff --git a/src/backend/metadata.h b/src/backend/metadata.h index c85acbe1..1bf040c2 100644 --- a/src/backend/metadata.h +++ b/src/backend/metadata.h @@ -172,7 +172,7 @@ namespace loot { //For 'enabled' and 'priority' metadata, use the given plugin's values, but if the 'priority' user value is zero, ignore it. void MergeMetadata(const Plugin& plugin); - //Returns the difference in metadata between the two plugins. + //Returns the difference in metadata between the two plugins. //For 'enabled', use the given plugin's value. //For 'priority', use the given plugin's value, unless it is equal to this plugin's value, in which case return 0. Plugin DiffMetadata(const Plugin& plugin) const; diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 3dc8abae..b2b29b74 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -56,7 +56,7 @@ namespace loot { LootState g_app_state = LootState(); LootApp::LootApp() {} - + CefRefPtr LootApp::GetBrowserProcessHandler() { return this; } @@ -257,7 +257,8 @@ namespace loot { newGameFolders.insert(game.FolderName()); } - // Remove deleted games. As the current game is stored using its index, + // Remove deleted games. As the current game is stored using its index, + // removing an earlier game may invalidate it. for (auto it = _games.begin(); it != _games.end();) { if (newGameFolders.find(it->FolderName()) == newGameFolders.end()) { @@ -321,7 +322,7 @@ namespace loot { BOOST_LOG_TRIVIAL(error) << "Failed to save LOOT's settings. Error: " << e.what(); } } - + bool LootState::AreSettingsValid() { if (!_settings["language"]) { if (_settings["Language"]) { diff --git a/src/gui/app.h b/src/gui/app.h index 33cae986..5f595761 100644 --- a/src/gui/app.h +++ b/src/gui/app.h @@ -34,7 +34,7 @@ namespace loot { - class LootApp : public CefApp, + class LootApp : public CefApp, public CefBrowserProcessHandler, public CefRenderProcessHandler { public: @@ -66,7 +66,7 @@ namespace loot { public: LootState(); - // Init may fail with no + // Init may fail with no void Init(const std::string& cmdLineGame); const std::vector& InitErrors() const; diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index 759a2502..f236ec60 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -189,7 +189,6 @@ namespace loot { bool Handler::HandleComplexQuery(CefRefPtr browser, YAML::Node& request, CefRefPtr callback) { - const string requestName = request["name"].as(); if (requestName == "find") { @@ -254,7 +253,7 @@ namespace loot { } else if (requestName == "closeSettings") { BOOST_LOG_TRIVIAL(trace) << "Settings dialog closed and changes accepted, updating settings object."; - + // Update the game details and settings. g_app_state.UpdateSettings(request["args"][0]); // If the user has deleted a default game, we don't want to restore it now. @@ -733,7 +732,8 @@ namespace loot { } catch (loot::error &e) { if (e.code() == loot::error::ok) { - // There was a parsing error, but roll-back was successful, so the process + // There was a parsing error, but roll-back was successful, so the process + // should still complete. g_app_state.CurrentGame().masterlist.messages.push_back(Message(Message::error, e.what())); wasChanged = true; @@ -914,7 +914,6 @@ namespace loot { } YAML::Node Handler::GenerateDerivedMetadata(const std::string& pluginName) { - // Now rederive the displayed metadata from the masterlist and userlist. auto pluginIt = g_app_state.CurrentGame().plugins.find(boost::locale::to_lower(pluginName)); if (pluginIt != g_app_state.CurrentGame().plugins.end()) { @@ -939,7 +938,8 @@ namespace loot { } // The clipboard takes a Unicode (ie. UTF-16) string that it then owns and must not - // be destroyed by LOOT. Convert the string, then copy it into a new block of + // be destroyed by LOOT. Convert the string, then copy it into a new block of + // memory for the clipboard. wstring wtext = ToWinWide(text); wchar_t * wcstr = new wchar_t[wtext.length() + 1]; @@ -981,7 +981,7 @@ namespace loot { CefRefPtr LootHandler::GetLifeSpanHandler() { return this; } - + CefRefPtr LootHandler::GetLoadHandler() { return this; } @@ -1133,7 +1133,7 @@ namespace loot { << "

Failed to load URL " << std::string(failedUrl) << " with error " << std::string(errorText) << " (" << errorCode << ").

"; - + frame->LoadString(ss.str(), failedUrl); } diff --git a/src/gui/handler.h b/src/gui/handler.h index d4d72978..a3910cf6 100644 --- a/src/gui/handler.h +++ b/src/gui/handler.h @@ -62,7 +62,7 @@ namespace loot { void SortPlugins(CefRefPtr callback); // Handle queries with input arguments. - bool HandleComplexQuery(CefRefPtr browser, YAML::Node& request, + bool HandleComplexQuery(CefRefPtr browser, YAML::Node& request, CefRefPtr callback); void Find(CefRefPtr browser, const std::string& search); @@ -75,7 +75,7 @@ namespace loot { YAML::Node Handler::GenerateDerivedMetadata(const std::string& pluginName); YAML::Node Handler::GenerateDerivedMetadata(const Plugin& file, const Plugin& masterlist, const Plugin& userlist); - void CopyToClipboard(const std::string& text); + void CopyToClipboard(const std::string& text); private: IMPLEMENT_REFCOUNTING(Handler); }; @@ -129,9 +129,9 @@ namespace loot { return this; } - virtual bool OnBeforeBrowse(CefRefPtr< CefBrowser > browser, - CefRefPtr< CefFrame > frame, - CefRefPtr< CefRequest > request, + virtual bool OnBeforeBrowse(CefRefPtr< CefBrowser > browser, + CefRefPtr< CefFrame > frame, + CefRefPtr< CefRequest > request, bool is_redirect) OVERRIDE; // Request that all existing browser windows close. diff --git a/src/gui/main_win.cpp b/src/gui/main_win.cpp index 526509c0..75b4325f 100644 --- a/src/gui/main_win.cpp +++ b/src/gui/main_win.cpp @@ -51,7 +51,7 @@ CefSettings GetCefSettings() { // Set CEF logging. CefString(&cef_settings.log_file).FromString((g_path_local / "CEFDebugLog.txt").string()); - + // Enable remote debugging. cef_settings.remote_debugging_port = 8080;