From f7a2b5112e392784c79ba8321f61e6419ac2f375 Mon Sep 17 00:00:00 2001 From: Charles Dang Date: Wed, 23 Aug 2017 15:51:08 +1100 Subject: [PATCH] GUI2/Dispatcher: changed dispatcher signals to take a widget reference as a first parameter This fixes an issue where functions taking `widget` as a parameter couldn't be bound to a signal function with the first argument passed via placeholder since `std::bind` requires arguments match exactly when using the placeholders. The dispatcher's `this` was cast to `widget` before the signal functions were fired anyway, so this doesn't really constitute any functional change. --- src/gui/core/event/dispatcher.cpp | 2 +- src/gui/core/event/dispatcher.hpp | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/gui/core/event/dispatcher.cpp b/src/gui/core/event/dispatcher.cpp index 1d8e0ba77d15..119e9749c8b8 100644 --- a/src/gui/core/event/dispatcher.cpp +++ b/src/gui/core/event/dispatcher.cpp @@ -198,7 +198,7 @@ bool dispatcher::execute_hotkey(const hotkey::HOTKEY_COMMAND id) return false; } - return itor->second(*this, id); + return itor->second(dynamic_cast(*this), id); } } // namespace event diff --git a/src/gui/core/event/dispatcher.hpp b/src/gui/core/event/dispatcher.hpp index 3d4e6a547e2b..75237b930146 100644 --- a/src/gui/core/event/dispatcher.hpp +++ b/src/gui/core/event/dispatcher.hpp @@ -51,7 +51,7 @@ struct message; * * This function is used for the callbacks in set_event. */ -typedef std::function signal_function; @@ -60,7 +60,7 @@ typedef std::function signal_text_input_function; /** Hotkey function handler signature. */ -typedef std::function hotkey_function; /** @@ -155,7 +155,7 @@ typedef std::function