summaryrefslogtreecommitdiff
path: root/editor/filesystem_dock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/filesystem_dock.cpp')
-rw-r--r--editor/filesystem_dock.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/editor/filesystem_dock.cpp b/editor/filesystem_dock.cpp
index 39452b7192..72fc9fbc6e 100644
--- a/editor/filesystem_dock.cpp
+++ b/editor/filesystem_dock.cpp
@@ -64,7 +64,7 @@ bool FileSystemDock::_create_tree(TreeItem *p_parent, EditorFileSystemDirectory
// Create a tree item for the subdirectory.
TreeItem *subdirectory_item = tree->create_item(p_parent);
String dname = p_dir->get_name();
- if (dname == "") {
+ if (dname.is_empty()) {
dname = "res://";
}
@@ -923,7 +923,7 @@ void FileSystemDock::_update_file_list(bool p_keep_selection) {
files->select(item_index, false);
}
- if (!p_keep_selection && file != "" && fname == file) {
+ if (!p_keep_selection && !file.is_empty() && fname == file) {
files->select(item_index, true);
files->ensure_current_is_visible();
}
@@ -1670,7 +1670,7 @@ Vector<String> FileSystemDock::_remove_self_included_paths(Vector<String> select
selected_strings.sort_custom<NaturalNoCaseComparator>();
String last_path = "";
for (int i = 0; i < selected_strings.size(); i++) {
- if (last_path != "" && selected_strings[i].begins_with(last_path)) {
+ if (!last_path.is_empty() && selected_strings[i].begins_with(last_path)) {
selected_strings.remove_at(i);
i--;
}
@@ -2016,7 +2016,7 @@ void FileSystemDock::_search_changed(const String &p_text, const Control *p_from
tree_search_box->set_text(searched_string);
}
- bool unfold_path = (p_text == String() && path != String());
+ bool unfold_path = (p_text.is_empty() && !path.is_empty());
switch (display_mode) {
case DISPLAY_MODE_TREE_ONLY: {
_update_tree(searched_string.length() == 0 ? uncollapsed_paths_before_search : Vector<String>(), false, false, unfold_path);
@@ -2665,7 +2665,7 @@ void FileSystemDock::_get_imported_files(const String &p_path, Vector<String> &f
DirAccess *da = DirAccess::open(p_path);
da->list_dir_begin();
String n = da->get_next();
- while (n != String()) {
+ while (!n.is_empty()) {
if (n != "." && n != ".." && !n.ends_with(".import")) {
String npath = p_path + n + (da->current_is_dir() ? "/" : "");
_get_imported_files(npath, files);
@@ -2720,7 +2720,7 @@ void FileSystemDock::_update_import_dock() {
if (cf->has_section_key("remap", "type")) {
type = cf->get_value("remap", "type");
}
- if (import_type == "") {
+ if (import_type.is_empty()) {
import_type = type;
} else if (import_type != type) {
// All should be the same type.