You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +00:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@@ -36,7 +36,6 @@
|
||||
#include "main/main.h"
|
||||
|
||||
void BackgroundProgress::_add_task(const String &p_task, const String &p_label, int p_steps) {
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
ERR_FAIL_COND_MSG(tasks.has(p_task), "Task '" + p_task + "' already exists.");
|
||||
BackgroundProgress::Task t;
|
||||
@@ -61,11 +60,9 @@ void BackgroundProgress::_add_task(const String &p_task, const String &p_label,
|
||||
}
|
||||
|
||||
void BackgroundProgress::_update() {
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
for (Map<String, int>::Element *E = updates.front(); E; E = E->next()) {
|
||||
|
||||
if (tasks.has(E->key())) {
|
||||
_task_step(E->key(), E->get());
|
||||
}
|
||||
@@ -75,7 +72,6 @@ void BackgroundProgress::_update() {
|
||||
}
|
||||
|
||||
void BackgroundProgress::_task_step(const String &p_task, int p_step) {
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
ERR_FAIL_COND(!tasks.has(p_task));
|
||||
@@ -87,7 +83,6 @@ void BackgroundProgress::_task_step(const String &p_task, int p_step) {
|
||||
t.progress->set_value(p_step);
|
||||
}
|
||||
void BackgroundProgress::_end_task(const String &p_task) {
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
ERR_FAIL_COND(!tasks.has(p_task));
|
||||
@@ -98,7 +93,6 @@ void BackgroundProgress::_end_task(const String &p_task) {
|
||||
}
|
||||
|
||||
void BackgroundProgress::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_add_task", &BackgroundProgress::_add_task);
|
||||
ClassDB::bind_method("_task_step", &BackgroundProgress::_task_step);
|
||||
ClassDB::bind_method("_end_task", &BackgroundProgress::_end_task);
|
||||
@@ -106,11 +100,9 @@ void BackgroundProgress::_bind_methods() {
|
||||
}
|
||||
|
||||
void BackgroundProgress::add_task(const String &p_task, const String &p_label, int p_steps) {
|
||||
|
||||
MessageQueue::get_singleton()->push_call(this, "_add_task", p_task, p_label, p_steps);
|
||||
}
|
||||
void BackgroundProgress::task_step(const String &p_task, int p_step) {
|
||||
|
||||
//this code is weird, but it prevents deadlock.
|
||||
bool no_updates = true;
|
||||
{
|
||||
@@ -128,7 +120,6 @@ void BackgroundProgress::task_step(const String &p_task, int p_step) {
|
||||
}
|
||||
|
||||
void BackgroundProgress::end_task(const String &p_task) {
|
||||
|
||||
MessageQueue::get_singleton()->push_call(this, "_end_task", p_task);
|
||||
}
|
||||
|
||||
@@ -137,11 +128,8 @@ void BackgroundProgress::end_task(const String &p_task) {
|
||||
ProgressDialog *ProgressDialog::singleton = NULL;
|
||||
|
||||
void ProgressDialog::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
|
||||
case NOTIFICATION_DRAW: {
|
||||
|
||||
Ref<StyleBox> style = get_stylebox("panel", "PopupMenu");
|
||||
draw_style_box(style, Rect2(Point2(), get_size()));
|
||||
|
||||
@@ -150,7 +138,6 @@ void ProgressDialog::_notification(int p_what) {
|
||||
}
|
||||
|
||||
void ProgressDialog::_popup() {
|
||||
|
||||
Size2 ms = main->get_combined_minimum_size();
|
||||
ms.width = MAX(500 * EDSCALE, ms.width);
|
||||
|
||||
@@ -166,7 +153,6 @@ void ProgressDialog::_popup() {
|
||||
}
|
||||
|
||||
void ProgressDialog::add_task(const String &p_task, const String &p_label, int p_steps, bool p_can_cancel) {
|
||||
|
||||
if (MessageQueue::get_singleton()->is_flushing()) {
|
||||
ERR_PRINT("Do not use progress dialog (task) while flushing the message queue or using call_deferred()!");
|
||||
return;
|
||||
@@ -202,7 +188,6 @@ void ProgressDialog::add_task(const String &p_task, const String &p_label, int p
|
||||
}
|
||||
|
||||
bool ProgressDialog::task_step(const String &p_task, const String &p_state, int p_step, bool p_force_redraw) {
|
||||
|
||||
ERR_FAIL_COND_V(!tasks.has(p_task), cancelled);
|
||||
|
||||
Task &t = tasks[p_task];
|
||||
@@ -228,7 +213,6 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int
|
||||
}
|
||||
|
||||
void ProgressDialog::end_task(const String &p_task) {
|
||||
|
||||
ERR_FAIL_COND(!tasks.has(p_task));
|
||||
Task &t = tasks[p_task];
|
||||
|
||||
@@ -250,7 +234,6 @@ void ProgressDialog::_bind_methods() {
|
||||
}
|
||||
|
||||
ProgressDialog::ProgressDialog() {
|
||||
|
||||
main = memnew(VBoxContainer);
|
||||
add_child(main);
|
||||
main->set_anchors_and_margins_preset(Control::PRESET_WIDE);
|
||||
|
||||
Reference in New Issue
Block a user