| 1562 | } |
| 1563 | |
| 1564 | bool Object::is_connected(const StringName &p_signal, const Callable &p_callable) const { |
| 1565 | ERR_FAIL_COND_V_MSG(p_callable.is_null(), false, vformat("Cannot determine if connected to '%s': the provided callable is null.", p_signal)); // Should use `is_null`, see note in `connect` about the use of `is_valid`. |
| 1566 | OBJ_SIGNAL_LOCK |
| 1567 | |
| 1568 | const SignalData *s = signal_map.getptr(p_signal); |
| 1569 | if (!s) { |
| 1570 | bool signal_is_valid = ClassDB::has_signal(get_class_name(), p_signal); |
| 1571 | if (signal_is_valid) { |
| 1572 | return false; |
| 1573 | } |
| 1574 | |
| 1575 | if (!script.is_null() && Ref<Script>(script)->has_script_signal(p_signal)) { |
| 1576 | return false; |
| 1577 | } |
| 1578 | |
| 1579 | ERR_FAIL_V_MSG(false, vformat("Nonexistent signal: '%s'.", p_signal)); |
| 1580 | } |
| 1581 | |
| 1582 | return s->slot_map.has(*p_callable.get_base_comparator()); |
| 1583 | } |
| 1584 | |
| 1585 | bool Object::has_connections(const StringName &p_signal) const { |
| 1586 | OBJ_SIGNAL_LOCK |
nothing calls this directly
no test coverage detected