From 30d0ca97664a7645ce8b2af7d169f0cee3248953 Mon Sep 17 00:00:00 2001 From: Ariel Manzur Date: Sat, 27 Feb 2016 12:11:40 -0300 Subject: [PATCH] added [presets] to ._sc_ and "android/shutdown_adb_on_exit" to editor_settings --- platform/android/export/export.cpp | 10 ++++++++++ tools/editor/editor_settings.cpp | 26 +++++++++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index d4755f4ed63..6fc78e32643 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1493,6 +1493,16 @@ void EditorExportPlatformAndroid::_device_poll_thread(void *ud) { OS::get_singleton()->delay_usec(3000000); } + if (EditorSettings::get_singleton()->get("android/shutdown_adb_on_exit")) { + String adb=EditorSettings::get_singleton()->get("android/adb"); + if (!FileAccess::exists(adb)) { + return; //adb not configured + } + + List args; + args.push_back("kill-server"); + OS::get_singleton()->execute(adb,args,true); + }; } Error EditorExportPlatformAndroid::run(int p_device, int p_flags) { diff --git a/tools/editor/editor_settings.cpp b/tools/editor/editor_settings.cpp index 83071a2e15d..d7df6614732 100644 --- a/tools/editor/editor_settings.cpp +++ b/tools/editor/editor_settings.cpp @@ -564,13 +564,29 @@ void EditorSettings::_load_defaults(Ref p_extra_config) { set("resources/save_compressed_resources",true); set("resources/auto_reload_modified_images",true); - if (p_extra_config.is_valid() && p_extra_config->has_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) { + if (p_extra_config.is_valid()) { - Vector list = p_extra_config->get_value("init_projects", "list"); - for (int i=0; ihas_section("init_projects") && p_extra_config->has_section_key("init_projects", "list")) { - String name = list[i].replace("/", "::"); - set("projects/"+name, list[i]); + Vector list = p_extra_config->get_value("init_projects", "list"); + for (int i=0; ihas_section("presets")) { + + List keys; + p_extra_config->get_section_keys("presets", &keys); + + for (List::Element *E=keys.front();E;E=E->next()) { + + String key = E->get(); + Variant val = p_extra_config->get_value("presets", key); + set(key, val); + }; }; };