diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/object.cpp | 18 | ||||
-rw-r--r-- | core/object.h | 1 | ||||
-rw-r--r-- | core/os/os.cpp | 9 | ||||
-rw-r--r-- | core/os/os.h | 1 |
4 files changed, 29 insertions, 0 deletions
diff --git a/core/object.cpp b/core/object.cpp index d7878fd623..bedab63281 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1383,6 +1383,24 @@ void Object::get_signal_connection_list(const StringName& p_signal,List<Connecti } +bool Object::has_persistent_signal_connections() const { + + const StringName *S=NULL; + + while((S=signal_map.next(S))) { + + const Signal *s=&signal_map[*S]; + + for(int i=0;i<s->slot_map.size();i++) { + + if (s->slot_map.getv(i).conn.flags&CONNECT_PERSIST) + return true; + } + } + + return false; +} + Error Object::connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds,uint32_t p_flags) { diff --git a/core/object.h b/core/object.h index f4a2472e88..e886aa3459 100644 --- a/core/object.h +++ b/core/object.h @@ -604,6 +604,7 @@ public: void get_signal_list(List<MethodInfo> *p_signals ) const; void get_signal_connection_list(const StringName& p_signal,List<Connection> *p_connections) const; void get_all_signal_connections(List<Connection> *p_connections) const; + bool has_persistent_signal_connections() const; Error connect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method,const Vector<Variant>& p_binds=Vector<Variant>(),uint32_t p_flags=0); void disconnect(const StringName& p_signal, Object *p_to_object, const StringName& p_to_method); diff --git a/core/os/os.cpp b/core/os/os.cpp index 6910b368d3..4daf41e68e 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -306,6 +306,15 @@ String OS::get_system_dir(SystemDir p_dir) const { return "."; } +String OS::get_safe_application_name() const { + String an = Globals::get_singleton()->get("application/name"); + Vector<String> invalid_char = String("\\ / : * ? \" < > |").split(" "); + for (int i=0;i<invalid_char.size();i++) { + an = an.replace(invalid_char[i],"-"); + } + return an; +} + String OS::get_data_dir() const { return "."; diff --git a/core/os/os.h b/core/os/os.h index 76dd235d24..a1047bd48f 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -326,6 +326,7 @@ public: virtual String get_locale() const; + String get_safe_application_name() const; virtual String get_data_dir() const; virtual String get_resource_dir() const; |