Remove Signal connect binds

Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
This commit is contained in:
Juan Linietsky
2022-07-28 22:56:41 +02:00
parent 14d021287b
commit d4433ae6d3
149 changed files with 645 additions and 708 deletions

View File

@@ -271,22 +271,20 @@ public:
static SignalWatcher *get_singleton() { return singleton; }
void watch_signal(Object *p_object, const String &p_signal) {
Vector<Variant> args;
args.push_back(p_signal);
MethodInfo method_info;
ClassDB::get_signal(p_object->get_class(), p_signal, &method_info);
switch (method_info.arguments.size()) {
case 0: {
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_zero), args);
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_zero).bind(p_signal));
} break;
case 1: {
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_one), args);
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_one).bind(p_signal));
} break;
case 2: {
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_two), args);
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_two).bind(p_signal));
} break;
case 3: {
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_three), args);
p_object->connect(p_signal, callable_mp(this, &SignalWatcher::_signal_callback_three).bind(p_signal));
} break;
default: {
MESSAGE("Signal ", p_signal, " arg count not supported.");