summaryrefslogtreecommitdiff
path: root/editor/editor_log.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_log.cpp')
-rw-r--r--editor/editor_log.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/editor/editor_log.cpp b/editor/editor_log.cpp
index 251e1c2385..db4de3bed0 100644
--- a/editor/editor_log.cpp
+++ b/editor/editor_log.cpp
@@ -5,8 +5,8 @@
/* GODOT ENGINE */
/* https://godotengine.org */
/*************************************************************************/
-/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
-/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
+/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */
+/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */
/* */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the */
@@ -45,9 +45,9 @@ void EditorLog::_error_handler(void *p_self, const char *p_func, const char *p_f
String err_str;
if (p_errorexp && p_errorexp[0]) {
- err_str = p_errorexp;
+ err_str = String::utf8(p_errorexp);
} else {
- err_str = String(p_file) + ":" + itos(p_line) + " - " + String(p_error);
+ err_str = String::utf8(p_file) + ":" + itos(p_line) + " - " + String::utf8(p_error);
}
if (p_editor_notify) {
@@ -84,6 +84,7 @@ void EditorLog::_update_theme() {
copy_button->set_icon(get_theme_icon(SNAME("ActionCopy"), SNAME("EditorIcons")));
collapse_button->set_icon(get_theme_icon(SNAME("CombineLines"), SNAME("EditorIcons")));
show_search_button->set_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
+ search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
}
void EditorLog::_notification(int p_what) {
@@ -162,11 +163,11 @@ void EditorLog::_clear_request() {
void EditorLog::_copy_request() {
String text = log->get_selected_text();
- if (text == "") {
+ if (text.is_empty()) {
text = log->get_text();
}
- if (text != "") {
+ if (!text.is_empty()) {
DisplayServer::get_singleton()->clipboard_set(text);
}
}
@@ -237,7 +238,7 @@ void EditorLog::_add_log_line(LogMessage &p_message, bool p_replace_previous) {
// Only add the message to the log if it passes the filters.
bool filter_active = type_filter_map[p_message.type]->is_active();
String search_text = search_box->get_text();
- bool search_match = search_text == String() || p_message.text.findn(search_text) > -1;
+ bool search_match = search_text.is_empty() || p_message.text.findn(search_text) > -1;
if (!filter_active || !search_match) {
return;
@@ -348,7 +349,6 @@ EditorLog::EditorLog() {
search_box = memnew(LineEdit);
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
search_box->set_placeholder(TTR("Filter messages"));
- search_box->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons")));
search_box->set_clear_button_enabled(true);
search_box->set_visible(true);
search_box->connect("text_changed", callable_mp(this, &EditorLog::_search_changed));
@@ -366,7 +366,7 @@ EditorLog::EditorLog() {
clear_button = memnew(Button);
clear_button->set_flat(true);
clear_button->set_focus_mode(FOCUS_NONE);
- clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_K));
+ clear_button->set_shortcut(ED_SHORTCUT("editor/clear_output", TTR("Clear Output"), KeyModifierMask::CMD | KeyModifierMask::SHIFT | Key::K));
clear_button->set_shortcut_context(this);
clear_button->connect("pressed", callable_mp(this, &EditorLog::_clear_request));
hb_tools->add_child(clear_button);
@@ -375,7 +375,7 @@ EditorLog::EditorLog() {
copy_button = memnew(Button);
copy_button->set_flat(true);
copy_button->set_focus_mode(FOCUS_NONE);
- copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KEY_MASK_CMD | KEY_C));
+ copy_button->set_shortcut(ED_SHORTCUT("editor/copy_output", TTR("Copy Selection"), KeyModifierMask::CMD | Key::C));
copy_button->set_shortcut_context(this);
copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
hb_tools->add_child(copy_button);
@@ -401,7 +401,7 @@ EditorLog::EditorLog() {
show_search_button->set_focus_mode(FOCUS_NONE);
show_search_button->set_toggle_mode(true);
show_search_button->set_pressed(true);
- show_search_button->set_shortcut(ED_SHORTCUT("editor/open_search", TTR("Focus Search/Filter Bar"), KEY_MASK_CMD | KEY_F));
+ show_search_button->set_shortcut(ED_SHORTCUT("editor/open_search", TTR("Focus Search/Filter Bar"), KeyModifierMask::CMD | Key::F));
show_search_button->set_shortcut_context(this);
show_search_button->connect("toggled", callable_mp(this, &EditorLog::_set_search_visible));
hb_tools2->add_child(show_search_button);
@@ -429,7 +429,7 @@ EditorLog::EditorLog() {
vb_right->add_child(editor_filter->toggle_button);
type_filter_map.insert(MSG_TYPE_EDITOR, editor_filter);
- add_message(VERSION_FULL_NAME " (c) 2007-2021 Juan Linietsky, Ariel Manzur & Godot Contributors.");
+ add_message(VERSION_FULL_NAME " (c) 2007-2022 Juan Linietsky, Ariel Manzur & Godot Contributors.");
eh.errfunc = _error_handler;
eh.userdata = this;