Skip to content

Commit

Permalink
Rest cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AThousandShips committed Oct 4, 2024
1 parent dd86bdb commit 7d3d754
Show file tree
Hide file tree
Showing 86 changed files with 240 additions and 240 deletions.
6 changes: 3 additions & 3 deletions core/debugger/remote_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void RemoteDebugger::flush_output() {
}

while (errors.size()) {
ErrorMessage oe = errors.front()->get();
ErrorMessage oe = errors.get_front();
_put_msg("error", oe.serialize());
errors.pop_front();
}
Expand Down Expand Up @@ -388,8 +388,8 @@ Array RemoteDebugger::_get_message() {

Array msg;
msg.resize(2);
msg[0] = message_list.front()->get().message;
msg[1] = message_list.front()->get().data;
msg[0] = message_list.get_front().message;
msg[1] = message_list.get_front().data;
message_list.pop_front();
return msg;
}
Expand Down
2 changes: 1 addition & 1 deletion core/input/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ void Input::parse_input_event(const Ref<InputEvent> &p_event) {
#endif

if (use_accumulated_input) {
if (buffered_events.is_empty() || !buffered_events.back()->get()->accumulate(p_event)) {
if (buffered_events.is_empty() || !buffered_events.get_back()->accumulate(p_event)) {
buffered_events.push_back(p_event);
}
} else if (agile_input_event_flushing) {
Expand Down
4 changes: 2 additions & 2 deletions core/io/file_access_pack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ Error DirAccessPack::list_dir_begin() {
String DirAccessPack::get_next() {
if (list_dirs.size()) {
cdir = true;
String d = list_dirs.front()->get();
String d = list_dirs.get_front();
list_dirs.pop_front();
return d;
} else if (list_files.size()) {
cdir = false;
String f = list_files.front()->get();
String f = list_files.get_front();
list_files.pop_front();
return f;
} else {
Expand Down
10 changes: 5 additions & 5 deletions core/io/plist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {
// Add subnode end enter it.
Ref<PListNode> dict = PListNode::new_dict();
dict->data_type = PList::PLNodeType::PL_NODE_TYPE_DICT;
if (!stack.back()->get()->push_subnode(dict, key)) {
if (!stack.get_back()->push_subnode(dict, key)) {
r_err_out = "Can't push subnode, invalid parent type.";
return false;
}
Expand All @@ -721,7 +721,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {

if (token == "/dict") {
// Exit current dict.
if (stack.is_empty() || stack.back()->get()->data_type != PList::PLNodeType::PL_NODE_TYPE_DICT) {
if (stack.is_empty() || stack.get_back()->data_type != PList::PLNodeType::PL_NODE_TYPE_DICT) {
r_err_out = "Mismatched </dict> tag.";
return false;
}
Expand All @@ -733,7 +733,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {
if (!stack.is_empty()) {
// Add subnode end enter it.
Ref<PListNode> arr = PListNode::new_array();
if (!stack.back()->get()->push_subnode(arr, key)) {
if (!stack.get_back()->push_subnode(arr, key)) {
r_err_out = "Can't push subnode, invalid parent type.";
return false;
}
Expand All @@ -753,7 +753,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {

if (token == "/array") {
// Exit current array.
if (stack.is_empty() || stack.back()->get()->data_type != PList::PLNodeType::PL_NODE_TYPE_ARRAY) {
if (stack.is_empty() || stack.get_back()->data_type != PList::PLNodeType::PL_NODE_TYPE_ARRAY) {
r_err_out = "Mismatched </array> tag.";
return false;
}
Expand Down Expand Up @@ -800,7 +800,7 @@ bool PList::load_string(const String &p_string, String &r_err_out) {
r_err_out = vformat("Invalid value type: %s.", token);
return false;
}
if (stack.is_empty() || !stack.back()->get()->push_subnode(var, key)) {
if (stack.is_empty() || !stack.get_back()->push_subnode(var, key)) {
r_err_out = "Can't push subnode, invalid parent type.";
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,7 @@ void ResourceLoader::reload_translation_remaps() {

//now just make sure to not delete any of these resources while changing locale..
while (to_reload.front()) {
to_reload.front()->get()->reload_from_file();
to_reload.get_front()->reload_from_file();
to_reload.pop_front();
}
}
Expand Down
6 changes: 3 additions & 3 deletions core/math/quick_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_

uint32_t debug_stop = debug_stop_after;

while (debug_stop > 0 && faces.back()->get().points_over.size()) {
while (debug_stop > 0 && faces.get_back().points_over.size()) {
debug_stop--;
Face &f = faces.back()->get();
Face &f = faces.get_back();

//find vertex most outside
int next = -1;
Expand Down Expand Up @@ -314,7 +314,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_
//erase lit faces

while (lit_faces.size()) {
faces.erase(lit_faces.front()->get());
faces.erase(lit_faces.get_front());
lit_faces.pop_front();
}

Expand Down
8 changes: 4 additions & 4 deletions core/object/object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ void Object::set_indexed(const Vector<StringName> &p_names, const Variant &p_val
}

for (int i = 1; i < p_names.size() - 1; i++) {
value_stack.push_back(value_stack.back()->get().get_named(p_names[i], valid));
value_stack.push_back(value_stack.get_back().get_named(p_names[i], valid));
if (r_valid) {
*r_valid = valid;
}
Expand All @@ -425,7 +425,7 @@ void Object::set_indexed(const Vector<StringName> &p_names, const Variant &p_val
value_stack.push_back(p_value); // p_names[p_names.size() - 1]

for (int i = p_names.size() - 1; i > 0; i--) {
value_stack.back()->prev()->get().set_named(p_names[i], value_stack.back()->get(), valid);
value_stack.back()->prev()->get().set_named(p_names[i], value_stack.get_back(), valid);
value_stack.pop_back();

if (r_valid) {
Expand All @@ -437,7 +437,7 @@ void Object::set_indexed(const Vector<StringName> &p_names, const Variant &p_val
}
}

set(p_names[0], value_stack.back()->get(), r_valid);
set(p_names[0], value_stack.get_back(), r_valid);
value_stack.pop_back();

ERR_FAIL_COND(!value_stack.is_empty());
Expand Down Expand Up @@ -2149,7 +2149,7 @@ Object::~Object() {

// Disconnect signals that connect to this object.
while (connections.size()) {
Connection c = connections.front()->get();
Connection c = connections.get_front();
Object *obj = c.callable.get_object();
bool disconnected = false;
if (likely(obj)) {
Expand Down
2 changes: 1 addition & 1 deletion core/object/script_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ void PlaceHolderScriptInstance::update(const List<PropertyInfo> &p_properties, c
}

while (to_remove.size()) {
values.erase(to_remove.front()->get());
values.erase(to_remove.get_front());
to_remove.pop_front();
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ ShaderGLES3::~ShaderGLES3() {
if (remaining.size()) {
ERR_PRINT(itos(remaining.size()) + " shaders of type " + name + " were never freed");
while (remaining.size()) {
version_free(remaining.front()->get());
version_free(remaining.get_front());
remaining.pop_front();
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/storage/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ void MaterialData::update_textures(const HashMap<StringName, Variant> &p_paramet
}

while (to_delete.front()) {
used_global_textures.erase(to_delete.front()->get());
used_global_textures.erase(to_delete.get_front());
to_delete.pop_front();
}
//handle registering/unregistering global textures
Expand Down
8 changes: 4 additions & 4 deletions editor/animation_track_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4160,10 +4160,10 @@ void AnimationTrackEditor::_insert_track(bool p_reset_wanted, bool p_create_bezi
TrackIndices next_tracks(animation.ptr(), reset_anim.ptr());
bool advance = false;
while (insert_data.size()) {
if (insert_data.front()->get().advance) {
if (insert_data.get_front().advance) {
advance = true;
}
next_tracks = _confirm_insert(insert_data.front()->get(), next_tracks, p_reset_wanted, reset_anim, p_create_beziers);
next_tracks = _confirm_insert(insert_data.get_front(), next_tracks, p_reset_wanted, reset_anim, p_create_beziers);
insert_data.pop_front();
}

Expand Down Expand Up @@ -4455,10 +4455,10 @@ void AnimationTrackEditor::_confirm_insert_list() {
TrackIndices next_tracks(animation.ptr(), reset_anim.ptr());
bool advance = false;
while (insert_data.size()) {
if (insert_data.front()->get().advance) {
if (insert_data.get_front().advance) {
advance = true;
}
next_tracks = _confirm_insert(insert_data.front()->get(), next_tracks, create_reset, reset_anim, insert_confirm_bezier->is_pressed());
next_tracks = _confirm_insert(insert_data.get_front(), next_tracks, create_reset, reset_anim, insert_confirm_bezier->is_pressed());
insert_data.pop_front();
}

Expand Down
4 changes: 2 additions & 2 deletions editor/animation_track_editor_plugins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ Rect2 AnimationTrackEditSpriteFrame::get_key_rect(int p_index, float p_pixels_se
int frame = get_animation()->track_get_key_value(get_track(), p_index);
String animation_name;
if (animations.size() == 1) {
animation_name = animations.front()->get();
animation_name = animations.get_front();
} else {
// Go through other track to find if animation is set
String animation_path = get_animation()->track_get_path(get_track());
Expand Down Expand Up @@ -503,7 +503,7 @@ void AnimationTrackEditSpriteFrame::draw_key(int p_index, float p_pixels_sec, in
int frame = get_animation()->track_get_key_value(get_track(), p_index);
String animation_name;
if (animations.size() == 1) {
animation_name = animations.front()->get();
animation_name = animations.get_front();
} else {
// Go through other track to find if animation is set
String animation_path = get_animation()->track_get_path(get_track());
Expand Down
2 changes: 1 addition & 1 deletion editor/audio_stream_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void AudioStreamPreviewGenerator::_notification(int p_what) {
}

while (to_erase.front()) {
previews.erase(to_erase.front()->get());
previews.erase(to_erase.get_front());
to_erase.pop_front();
}
} break;
Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/debug_adapter/debug_adapter_protocol.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Error DAPeer::handle_data() {

Error DAPeer::send_data() {
while (res_queue.size()) {
Dictionary data = res_queue.front()->get();
Dictionary data = res_queue.get_front();
if (!data.has("seq")) {
data["seq"] = ++seq;
}
Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_debugger_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void EditorDebuggerTree::_item_menu_id_pressed(int p_option) {
file_dialog->add_filter("*." + extension, extension.to_upper());
}

String filename = get_selected_path().get_file() + "." + extensions.front()->get().to_lower();
String filename = get_selected_path().get_file() + "." + extensions.get_front().to_lower();
file_dialog->set_current_path(filename);
file_dialog->popup_file_dialog();
} break;
Expand Down
2 changes: 1 addition & 1 deletion editor/debugger/editor_performance_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void EditorPerformanceProfiler::_build_monitor_tree() {
item->set_checked(0, monitor_checked.has(E.key));
E.value.item = item;
if (!E.value.history.is_empty()) {
E.value.update_value(E.value.history.front()->get());
E.value.update_value(E.value.history.get_front());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions editor/debugger/editor_visual_profiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void EditorVisualProfiler::add_frame_metric(const Metric &p_metric) {
}

if (stack.size()) {
full_name = stack.back()->get() + name;
full_name = stack.get_back() + name;
} else {
full_name = name;
}
Expand Down Expand Up @@ -337,7 +337,7 @@ void EditorVisualProfiler::_update_frame(bool p_focus_selected) {
TreeItem *ensure_selected = nullptr;

for (int i = 1; i < m.areas.size() - 1; i++) {
TreeItem *parent = stack.size() ? stack.back()->get() : root;
TreeItem *parent = stack.size() ? stack.get_back() : root;

String name = m.areas[i].name;

Expand Down
4 changes: 2 additions & 2 deletions editor/doc_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) {

// Populate documentation data for each exposed class.
while (classes.size()) {
const String &name = classes.front()->get();
const String &name = classes.get_front();
if (!ClassDB::is_class_exposed(name)) {
print_verbose(vformat("Class '%s' is not exposed, skipping.", name));
classes.pop_front();
Expand Down Expand Up @@ -1247,7 +1247,7 @@ Error DocTools::erase_classes(const String &p_dir) {
da->list_dir_end();

while (to_erase.size()) {
da->remove(to_erase.front()->get());
da->remove(to_erase.get_front());
to_erase.pop_front();
}

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_autoload_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ void EditorAutoloadSettings::update_autoload() {
autoload_cache.push_back(info);

if (need_to_add) {
to_add.push_back(&(autoload_cache.back()->get()));
to_add.push_back(&(autoload_cache.get_back()));
}

TreeItem *item = tree->create_item(root);
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_help.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2509,7 +2509,7 @@ static void _add_text_to_rt(const String &p_bbcode, RichTextLabel *p_rt, const C
const String tag = bbcode.substr(brk_pos + 1, brk_end - brk_pos - 1);

if (tag.begins_with("/")) {
bool tag_ok = tag_stack.size() && tag_stack.front()->get() == tag.substr(1);
bool tag_ok = tag_stack.size() && tag_stack.get_front() == tag.substr(1);

if (!tag_ok) {
p_rt->add_text("[");
Expand Down
12 changes: 6 additions & 6 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
} else {
if (extensions.size()) {
String resource_name_snake_case = p_resource->get_class().to_snake_case();
file->set_current_file("new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower());
file->set_current_file("new_" + resource_name_snake_case + "." + preferred.get_front().to_lower());
} else {
file->set_current_file(String());
}
Expand All @@ -1435,14 +1435,14 @@ void EditorNode::save_resource_as(const Ref<Resource> &p_resource, const String
if (extensions.size()) {
String ext = p_resource->get_path().get_extension().to_lower();
if (extensions.find(ext) == nullptr) {
file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.front()->get()));
file->set_current_path(p_resource->get_path().replacen("." + ext, "." + extensions.get_front()));
}
}
} else if (preferred.size()) {
String existing;
if (extensions.size()) {
String resource_name_snake_case = p_resource->get_class().to_snake_case();
existing = "new_" + resource_name_snake_case + "." + preferred.front()->get().to_lower();
existing = "new_" + resource_name_snake_case + "." + preferred.get_front().to_lower();
}
file->set_current_path(existing);
}
Expand Down Expand Up @@ -2683,7 +2683,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
break;
}
opening_prev = true;
open_request(previous_scenes.back()->get());
open_request(previous_scenes.get_back());
previous_scenes.pop_back();

} break;
Expand Down Expand Up @@ -2790,13 +2790,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
if (extensions.size()) {
String ext = path.get_extension().to_lower();
if (extensions.find(ext) == nullptr) {
file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get()));
file->set_current_path(path.replacen("." + ext, "." + extensions.get_front()));
}
}
} else if (extensions.size()) {
String root_name = scene->get_name();
root_name = EditorNode::adjust_scene_name_casing(root_name);
file->set_current_path(root_name + "." + extensions.front()->get().to_lower());
file->set_current_path(root_name + "." + extensions.get_front().to_lower());
}
file->set_title(TTR("Save Scene As..."));
file->popup_file_dialog();
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_resource_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void EditorResourcePreview::_iterate() {
return;
}

QueueItem item = queue.front()->get();
QueueItem item = queue.get_front();
queue.pop_front();

if (cache.has(item.path)) {
Expand Down
Loading

0 comments on commit 7d3d754

Please sign in to comment.