summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-11-15 16:25:31 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-11-15 16:25:31 +0100
commit7b3c1a0a83edfe9448b93f9bd3c832134d8d4ddd (patch)
treed84ee043fa9832c967a306c4102723780760045f /editor
parent2d3197c525a0d8eb07c7fee4c8d88b2d62c2b691 (diff)
parent747a96621193d29f4560378b870fe4cf51e9a12d (diff)
Merge pull request #68690 from KoBeWi/StringNoName
Change EditorQuickOpen base_type to String
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_quick_open.cpp8
-rw-r--r--editor/editor_quick_open.h6
2 files changed, 7 insertions, 7 deletions
diff --git a/editor/editor_quick_open.cpp b/editor/editor_quick_open.cpp
index b4ec3bca15..50429878f9 100644
--- a/editor/editor_quick_open.cpp
+++ b/editor/editor_quick_open.cpp
@@ -33,7 +33,7 @@
#include "core/os/keyboard.h"
#include "editor/editor_node.h"
-void EditorQuickOpen::popup_dialog(const StringName &p_base, bool p_enable_multi, bool p_dontclear) {
+void EditorQuickOpen::popup_dialog(const String &p_base, bool p_enable_multi, bool p_dontclear) {
base_type = p_base;
allow_multi_select = p_enable_multi;
search_options->set_select_mode(allow_multi_select ? Tree::SELECT_MULTI : Tree::SELECT_SINGLE);
@@ -56,7 +56,7 @@ void EditorQuickOpen::_build_search_cache(EditorFileSystemDirectory *p_efsd) {
_build_search_cache(p_efsd->get_subdir(i));
}
- Vector<String> base_types = String(base_type).split(String(","));
+ Vector<String> base_types = base_type.split(",");
for (int i = 0; i < p_efsd->get_file_count(); i++) {
String file = p_efsd->get_file_path(i);
String engine_type = p_efsd->get_file_type(i);
@@ -80,7 +80,7 @@ void EditorQuickOpen::_build_search_cache(EditorFileSystemDirectory *p_efsd) {
// Store refs to used icons.
String ext = file.get_extension();
if (!icons.has(ext)) {
- icons.insert(ext, get_theme_icon((has_theme_icon(actual_type, SNAME("EditorIcons")) ? actual_type : String("Object")), SNAME("EditorIcons")));
+ icons.insert(ext, get_theme_icon((has_theme_icon(actual_type, SNAME("EditorIcons")) ? actual_type : "Object"), SNAME("EditorIcons")));
}
// Stop testing base types as soon as we got a match.
@@ -231,7 +231,7 @@ Vector<String> EditorQuickOpen::get_selected_files() const {
return selected_files;
}
-StringName EditorQuickOpen::get_base_type() const {
+String EditorQuickOpen::get_base_type() const {
return base_type;
}
diff --git a/editor/editor_quick_open.h b/editor/editor_quick_open.h
index 83cbbd7cac..3b7e8136ef 100644
--- a/editor/editor_quick_open.h
+++ b/editor/editor_quick_open.h
@@ -41,7 +41,7 @@ class EditorQuickOpen : public ConfirmationDialog {
LineEdit *search_box = nullptr;
Tree *search_options = nullptr;
- StringName base_type;
+ String base_type;
bool allow_multi_select = false;
bool _load_resources = false; // Prohibitively slow for now.
@@ -77,12 +77,12 @@ protected:
static void _bind_methods();
public:
- StringName get_base_type() const;
+ String get_base_type() const;
String get_selected() const;
Vector<String> get_selected_files() const;
- void popup_dialog(const StringName &p_base, bool p_enable_multi = false, bool p_dontclear = false);
+ void popup_dialog(const String &p_base, bool p_enable_multi = false, bool p_dontclear = false);
EditorQuickOpen();
};