File diff r23537:f6a6d4ce4bd5 → r23538:8df50944b27a
src/hotkeys.cpp
Show inline comments
 
@@ -21,13 +21,13 @@
 
char *_hotkeys_file;
 

	
 
/**
 
 * List of all HotkeyLists.
 
 * This is a pointer to ensure initialisation order with the various static HotkeyList instances.
 
 */
 
static SmallVector<HotkeyList*, 16> *_hotkey_lists = NULL;
 
static std::vector<HotkeyList*> *_hotkey_lists = NULL;
 

	
 
/** String representation of a keycode */
 
struct KeycodeNames {
 
	const char *name;       ///< Name of the keycode
 
	WindowKeyCodes keycode; ///< The keycode
 
};
 
@@ -251,13 +251,13 @@ void Hotkey::AddKeycode(uint16 keycode)
 
	include(this->keycodes, keycode);
 
}
 

	
 
HotkeyList::HotkeyList(const char *ini_group, Hotkey *items, GlobalHotkeyHandlerFunc global_hotkey_handler) :
 
	global_hotkey_handler(global_hotkey_handler), ini_group(ini_group), items(items)
 
{
 
	if (_hotkey_lists == NULL) _hotkey_lists = new SmallVector<HotkeyList*, 16>();
 
	if (_hotkey_lists == NULL) _hotkey_lists = new std::vector<HotkeyList*>();
 
	_hotkey_lists->push_back(this);
 
}
 

	
 
HotkeyList::~HotkeyList()
 
{
 
	_hotkey_lists->erase(std::find(_hotkey_lists->begin(), _hotkey_lists->end(), this));