1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Style: Enforce braces around if blocks and loops

Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
Rémi Verschelde
2021-05-05 12:44:11 +02:00
parent b8d198eeed
commit 140350d767
694 changed files with 23283 additions and 12499 deletions

View File

@@ -77,10 +77,11 @@ void BackgroundProgress::_task_step(const String &p_task, int p_step) {
ERR_FAIL_COND(!tasks.has(p_task));
Task &t = tasks[p_task];
if (p_step < 0)
if (p_step < 0) {
t.progress->set_value(t.progress->get_value() + 1);
else
} else {
t.progress->set_value(p_step);
}
}
void BackgroundProgress::_end_task(const String &p_task) {
_THREAD_SAFE_METHOD_
@@ -110,8 +111,9 @@ void BackgroundProgress::task_step(const String &p_task, int p_step) {
no_updates = updates.empty();
}
if (no_updates)
if (no_updates) {
MessageQueue::get_singleton()->push_call(this, "_update");
}
{
_THREAD_SAFE_METHOD_
@@ -193,14 +195,16 @@ bool ProgressDialog::task_step(const String &p_task, const String &p_state, int
Task &t = tasks[p_task];
if (!p_force_redraw) {
uint64_t tus = OS::get_singleton()->get_ticks_usec();
if (tus - t.last_progress_tick < 200000) //200ms
if (tus - t.last_progress_tick < 200000) { //200ms
return cancelled;
}
}
if (p_step < 0)
if (p_step < 0) {
t.progress->set_value(t.progress->get_value() + 1);
else
} else {
t.progress->set_value(p_step);
}
t.state->set_text(p_state);
t.last_progress_tick = OS::get_singleton()->get_ticks_usec();
@@ -219,10 +223,11 @@ void ProgressDialog::end_task(const String &p_task) {
memdelete(t.vb);
tasks.erase(p_task);
if (tasks.empty())
if (tasks.empty()) {
hide();
else
} else {
_popup();
}
}
void ProgressDialog::_cancel_pressed() {