From 85f4f3927973fa7b106ee274033b1f0180ad4343 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 6 Jun 2016 19:55:50 -0300 Subject: Added function get_signals_connected_to_this_this() should help properly implement #5058 --- core/object.cpp | 7 +++++++ core/object.h | 1 + 2 files changed, 8 insertions(+) diff --git a/core/object.cpp b/core/object.cpp index bedab63281..cbe24a49f3 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1401,6 +1401,13 @@ bool Object::has_persistent_signal_connections() const { return false; } +void Object::get_signals_connected_to_this(List *p_connections) const { + + for (const List::Element *E=connections.front();E;E=E->next()) { + p_connections->push_back(E->get()); + } +} + Error Object::connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector& p_binds,uint32_t p_flags) { diff --git a/core/object.h b/core/object.h index e886aa3459..ce545a58e8 100644 --- a/core/object.h +++ b/core/object.h @@ -605,6 +605,7 @@ public: void get_signal_connection_list(const StringName& p_signal,List *p_connections) const; void get_all_signal_connections(List *p_connections) const; bool has_persistent_signal_connections() const; + void get_signals_connected_to_this(List *p_connections) const; Error connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector& p_binds=Vector(),uint32_t p_flags=0); void disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method); -- cgit v1.2.3