diff --git a/src/hotkey/hotkey_command.cpp b/src/hotkey/hotkey_command.cpp index 0d170695fabc..7524bc2fdd38 100644 --- a/src/hotkey/hotkey_command.cpp +++ b/src/hotkey/hotkey_command.cpp @@ -264,7 +264,7 @@ boost::ptr_vector known_hotkeys; std::map command_map_; // -std::vector scope_active_(hotkey::SCOPE_COUNT, false); +hotkey::hk_scopes scope_active_(0); } @@ -275,7 +275,7 @@ scope_changer::scope_changer() scope_changer::~scope_changer() { - scope_active_.swap(prev_scope_active_); + scope_active_ = prev_scope_active_; } diff --git a/src/hotkey/hotkey_command.hpp b/src/hotkey/hotkey_command.hpp index bc34b6723f4b..69e0a797ea2c 100644 --- a/src/hotkey/hotkey_command.hpp +++ b/src/hotkey/hotkey_command.hpp @@ -19,6 +19,7 @@ #include "tstring.hpp" #include "boost/ptr_container/ptr_vector.hpp" +#include class config; namespace hotkey { @@ -181,6 +182,8 @@ enum HOTKEY_COMMAND { HOTKEY_NULL }; +typedef std::bitset hk_scopes; + /// Stores all information related to functions that can be bound to hotkeys. /// this is currently a semi struct: it haves a constructor, but only const-public members. struct hotkey_command { @@ -234,7 +237,7 @@ class scope_changer { scope_changer(); ~scope_changer(); private: - std::vector prev_scope_active_; + hk_scopes prev_scope_active_; }; /// returns a container that contains all currently active hotkey_commands.