diff options
Diffstat (limited to 'modules/gdnative/gdnative_library_singleton_editor.cpp')
-rw-r--r-- | modules/gdnative/gdnative_library_singleton_editor.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/gdnative/gdnative_library_singleton_editor.cpp b/modules/gdnative/gdnative_library_singleton_editor.cpp index 378339ecea..409b6cbffe 100644 --- a/modules/gdnative/gdnative_library_singleton_editor.cpp +++ b/modules/gdnative/gdnative_library_singleton_editor.cpp @@ -35,7 +35,6 @@ #include "editor/editor_node.h" Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFileSystemDirectory *p_dir) { - Set<String> file_paths; // check children @@ -67,7 +66,6 @@ Set<String> GDNativeLibrarySingletonEditor::_find_singletons_recursive(EditorFil } void GDNativeLibrarySingletonEditor::_discover_singletons() { - EditorFileSystemDirectory *dir = EditorFileSystem::get_singleton()->get_filesystem(); Set<String> file_paths = _find_singletons_recursive(dir); @@ -97,7 +95,6 @@ void GDNativeLibrarySingletonEditor::_discover_singletons() { } if (changed) { - ProjectSettings::get_singleton()->set("gdnative/singletons", files); _update_libraries(); // So singleton options (i.e. disabled) updates too ProjectSettings::get_singleton()->save(); @@ -105,7 +102,6 @@ void GDNativeLibrarySingletonEditor::_discover_singletons() { } void GDNativeLibrarySingletonEditor::_update_libraries() { - updating = true; libraries->clear(); libraries->create_item(); // root item @@ -139,19 +135,22 @@ void GDNativeLibrarySingletonEditor::_update_libraries() { } // The singletons list changed, we must update the settings - if (updated_disabled.size() != singletons_disabled.size()) + if (updated_disabled.size() != singletons_disabled.size()) { ProjectSettings::get_singleton()->set("gdnative/singletons_disabled", updated_disabled); + } updating = false; } void GDNativeLibrarySingletonEditor::_item_edited() { - if (updating) + if (updating) { return; + } TreeItem *item = libraries->get_edited(); - if (!item) + if (!item) { return; + } bool enabled = item->get_range(1); String path = item->get_metadata(0); @@ -169,8 +168,9 @@ void GDNativeLibrarySingletonEditor::_item_edited() { if (enabled) { disabled_paths.erase(path); } else { - if (disabled_paths.find(path) == -1) + if (disabled_paths.find(path) == -1) { disabled_paths.push_back(path); + } } undo_redo->create_action(enabled ? TTR("Enabled GDNative Singleton") : TTR("Disabled GDNative Singleton")); @@ -182,7 +182,6 @@ void GDNativeLibrarySingletonEditor::_item_edited() { } void GDNativeLibrarySingletonEditor::_notification(int p_what) { - if (p_what == NOTIFICATION_VISIBILITY_CHANGED) { if (is_visible_in_tree()) { _update_libraries(); @@ -191,7 +190,6 @@ void GDNativeLibrarySingletonEditor::_notification(int p_what) { } void GDNativeLibrarySingletonEditor::_bind_methods() { - ClassDB::bind_method(D_METHOD("_update_libraries"), &GDNativeLibrarySingletonEditor::_update_libraries); } |