From dabcdb2e8bcb31f4382a5ad6aa47caaec491103a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 26 Jul 2011 19:52:36 +0000 Subject: [PATCH] Uninvert hotkey::Scan's return value Originally committed to SVN as r5506. --- aegisub/libaegisub/common/hotkey.cpp | 8 ++++---- aegisub/src/hotkey.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aegisub/libaegisub/common/hotkey.cpp b/aegisub/libaegisub/common/hotkey.cpp index d6614e27e..071225660 100644 --- a/aegisub/libaegisub/common/hotkey.cpp +++ b/aegisub/libaegisub/common/hotkey.cpp @@ -137,7 +137,7 @@ bool Hotkey::Scan(const std::string &context, const std::string &str, bool alway if (always && ctext == "Always") { cmd = index->second.CmdName(); LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Always Command: " << cmd; - return 0; + return true; } if (ctext == "Default") { dfault = index->second.CmdName(); @@ -150,15 +150,15 @@ bool Hotkey::Scan(const std::string &context, const std::string &str, bool alway if (!local.empty()) { cmd = local; LOG_D("agi/hotkey/found") << "Found: " << str << " Context: " << context << " Command: " << local; - return 0; + return true; } if (!dfault.empty()) { cmd = dfault; LOG_D("agi/hotkey/found") << "Found: " << str << " Context (req/found): " << context << "/Default Command: " << dfault; - return 0; + return true; } - return 1; + return false; } std::vector Hotkey::GetHotkeys(const std::string &context, const std::string &command) const { diff --git a/aegisub/src/hotkey.cpp b/aegisub/src/hotkey.cpp index db0d75adb..1f27396ed 100644 --- a/aegisub/src/hotkey.cpp +++ b/aegisub/src/hotkey.cpp @@ -69,7 +69,7 @@ bool check(std::string const& context, int key_code, wchar_t key_char, int modif if (combo.empty()) return false; std::string command; - if (agi::hotkey::hotkey->Scan(context, combo, OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool(), command) == 0) { + if (agi::hotkey::hotkey->Scan(context, combo, OPT_GET("Audio/Medusa Timing Hotkeys")->GetBool(), command)) { /// The bottom line should be removed after all the hotkey commands are fixed. /// This is to avoid pointless exceptions. if (command.find("/") != std::string::npos) {