Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
This commit is contained in:
@ -42,7 +42,6 @@
|
||||
#include "scene/gui/link_button.h"
|
||||
|
||||
void ExportTemplateManager::_update_template_list() {
|
||||
|
||||
while (current_hb->get_child_count()) {
|
||||
memdelete(current_hb->get_child(0));
|
||||
}
|
||||
@ -57,7 +56,6 @@ void ExportTemplateManager::_update_template_list() {
|
||||
Set<String> templates;
|
||||
d->list_dir_begin();
|
||||
if (err == OK) {
|
||||
|
||||
String c = d->get_next();
|
||||
while (c != String()) {
|
||||
if (d->current_is_dir() && !c.begins_with(".")) {
|
||||
@ -141,7 +139,6 @@ void ExportTemplateManager::_update_template_list() {
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_download_template(const String &p_version) {
|
||||
|
||||
while (template_list->get_child_count()) {
|
||||
memdelete(template_list->get_child(0));
|
||||
}
|
||||
@ -155,14 +152,12 @@ void ExportTemplateManager::_download_template(const String &p_version) {
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_uninstall_template(const String &p_version) {
|
||||
|
||||
remove_confirm->set_text(vformat(TTR("Remove template version '%s'?"), p_version));
|
||||
remove_confirm->popup_centered_minsize();
|
||||
to_remove = p_version;
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_uninstall_template_confirm() {
|
||||
|
||||
DirAccessRef da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
|
||||
const String &templates_dir = EditorSettings::get_singleton()->get_templates_dir();
|
||||
Error err = da->change_dir(templates_dir);
|
||||
@ -181,7 +176,6 @@ void ExportTemplateManager::_uninstall_template_confirm() {
|
||||
}
|
||||
|
||||
bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_progress) {
|
||||
|
||||
// unzClose() will take care of closing the file stored in the unzFile,
|
||||
// so we don't need to `memdelete(fa)` in this method.
|
||||
FileAccess *fa = NULL;
|
||||
@ -189,7 +183,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
|
||||
unzFile pkg = unzOpen2(p_file.utf8().get_data(), &io);
|
||||
if (!pkg) {
|
||||
|
||||
EditorNode::get_singleton()->show_warning(TTR("Can't open export templates zip."));
|
||||
return false;
|
||||
}
|
||||
@ -200,7 +193,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
String contents_dir;
|
||||
|
||||
while (ret == UNZ_OK) {
|
||||
|
||||
unz_file_info info;
|
||||
char fname[16384];
|
||||
ret = unzGetCurrentFileInfo(pkg, &info, fname, 16384, NULL, 0, NULL, 0);
|
||||
@ -208,7 +200,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
String file = fname;
|
||||
|
||||
if (file.ends_with("version.txt")) {
|
||||
|
||||
Vector<uint8_t> data;
|
||||
data.resize(info.uncompressed_size);
|
||||
|
||||
@ -266,7 +257,6 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
fc = 0;
|
||||
|
||||
while (ret == UNZ_OK) {
|
||||
|
||||
//get filename
|
||||
unz_file_info info;
|
||||
char fname[16384];
|
||||
@ -340,18 +330,15 @@ bool ExportTemplateManager::_install_from_file(const String &p_file, bool p_use_
|
||||
}
|
||||
|
||||
void ExportTemplateManager::popup_manager() {
|
||||
|
||||
_update_template_list();
|
||||
popup_centered_minsize(Size2(400, 400) * EDSCALE);
|
||||
}
|
||||
|
||||
void ExportTemplateManager::ok_pressed() {
|
||||
|
||||
template_open->popup_centered_ratio();
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
|
||||
|
||||
if (p_status != HTTPRequest::RESULT_SUCCESS || p_code != 200) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Error getting the list of mirrors."));
|
||||
return;
|
||||
@ -397,9 +384,7 @@ void ExportTemplateManager::_http_download_mirror_completed(int p_status, int p_
|
||||
}
|
||||
}
|
||||
void ExportTemplateManager::_http_download_templates_completed(int p_status, int p_code, const PoolStringArray &headers, const PoolByteArray &p_data) {
|
||||
|
||||
switch (p_status) {
|
||||
|
||||
case HTTPRequest::RESULT_CANT_RESOLVE: {
|
||||
template_list_state->set_text(TTR("Can't resolve."));
|
||||
} break;
|
||||
@ -445,7 +430,6 @@ void ExportTemplateManager::_http_download_templates_completed(int p_status, int
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_begin_template_download(const String &p_url) {
|
||||
|
||||
if (Input::get_singleton()->is_key_pressed(KEY_SHIFT)) {
|
||||
OS::get_singleton()->shell_open(p_url);
|
||||
return;
|
||||
@ -482,9 +466,7 @@ void ExportTemplateManager::_window_template_downloader_closed() {
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_notification(int p_what) {
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
||||
update_countdown -= get_process_delta_time();
|
||||
|
||||
if (update_countdown > 0) {
|
||||
@ -553,13 +535,11 @@ void ExportTemplateManager::_notification(int p_what) {
|
||||
}
|
||||
|
||||
bool ExportTemplateManager::can_install_android_template() {
|
||||
|
||||
const String templates_dir = EditorSettings::get_singleton()->get_templates_dir().plus_file(VERSION_FULL_CONFIG);
|
||||
return FileAccess::exists(templates_dir.plus_file("android_source.zip"));
|
||||
}
|
||||
|
||||
Error ExportTemplateManager::install_android_template() {
|
||||
|
||||
// To support custom Android builds, we install the Java source code and buildsystem
|
||||
// from android_source.zip to the project's res://android folder.
|
||||
|
||||
@ -616,7 +596,6 @@ Error ExportTemplateManager::install_android_template() {
|
||||
Set<String> dirs_tested;
|
||||
int idx = 0;
|
||||
while (ret == UNZ_OK) {
|
||||
|
||||
// Get file path.
|
||||
unz_file_info info;
|
||||
char fpath[16384];
|
||||
@ -665,7 +644,6 @@ Error ExportTemplateManager::install_android_template() {
|
||||
}
|
||||
|
||||
void ExportTemplateManager::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_download_template", &ExportTemplateManager::_download_template);
|
||||
ClassDB::bind_method("_uninstall_template", &ExportTemplateManager::_uninstall_template);
|
||||
ClassDB::bind_method("_uninstall_template_confirm", &ExportTemplateManager::_uninstall_template_confirm);
|
||||
@ -677,7 +655,6 @@ void ExportTemplateManager::_bind_methods() {
|
||||
}
|
||||
|
||||
ExportTemplateManager::ExportTemplateManager() {
|
||||
|
||||
VBoxContainer *main_vb = memnew(VBoxContainer);
|
||||
add_child(main_vb);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user