From cd4b032c25258dda1498da912a46b853b2ff8d73 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 17 Jan 2011 23:53:38 +0000 Subject: [PATCH] Make agi::hotkey::Scan const Originally committed to SVN as r5229. --- aegisub/libaegisub/common/hotkey.cpp | 6 +++--- aegisub/libaegisub/include/libaegisub/hotkey.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aegisub/libaegisub/common/hotkey.cpp b/aegisub/libaegisub/common/hotkey.cpp index fe3368b52..74b3b52ca 100644 --- a/aegisub/libaegisub/common/hotkey.cpp +++ b/aegisub/libaegisub/common/hotkey.cpp @@ -129,9 +129,9 @@ void Hotkey::BuildHotkey(std::string context, const json::Object& object) { } -bool Hotkey::Scan(const std::string &context, const std::string &str, std::string &cmd) { - HotkeyMap::iterator index; - std::pair range; +bool Hotkey::Scan(const std::string &context, const std::string &str, std::string &cmd) const { + HotkeyMap::const_iterator index; + std::pair range; range = map.equal_range(str); std::string local, dfault; diff --git a/aegisub/libaegisub/include/libaegisub/hotkey.h b/aegisub/libaegisub/include/libaegisub/hotkey.h index 3f69168ce..b0f913152 100644 --- a/aegisub/libaegisub/include/libaegisub/hotkey.h +++ b/aegisub/libaegisub/include/libaegisub/hotkey.h @@ -106,7 +106,7 @@ public: /// @param context Context requested. /// @param str Hyphen separated key sequence. /// @param[out] cmd Command found. - bool Scan(const std::string &context, const std::string &str, std::string &cmd); + bool Scan(const std::string &context, const std::string &str, std::string &cmd) const; private: typedef std::multimap HotkeyMap; ///< Map to hold Combo instances.