diff options
author | est31 <MTest31@outlook.com> | 2015-11-30 01:26:51 +0100 |
---|---|---|
committer | est31 <MTest31@outlook.com> | 2015-11-30 01:36:08 +0100 |
commit | 15f6d3cebf9e8c9288132454816f1152e16dde36 (patch) | |
tree | 21ebe9b3a928e682f195e66cc171f3c05efacd3a /platform/bb10/export | |
parent | 5e0419012a00631aac200739680b04446285eb14 (diff) |
Add way to look for templates at system wide level too
Useful for everybody wanting to package godot.
Fixes #1026.
-> Retain the old behaviour: path in error msg only when exporting.
-> User templates override system templates
Diffstat (limited to 'platform/bb10/export')
-rw-r--r-- | platform/bb10/export/export.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 434aaff414..2acd920f31 100644 --- a/platform/bb10/export/export.cpp +++ b/platform/bb10/export/export.cpp @@ -275,10 +275,16 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu EditorProgress ep("export","Exporting for BlackBerry 10",104); - String template_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - String src_template=custom_package!=""?custom_package:template_path.plus_file("bb10.zip"); - + String src_template=custom_package; + + if (src_template=="") { + String err; + src_template = find_export_template("bb10.zip", &err); + if (src_template=="") { + EditorNode::add_io_error(err); + return ERR_FILE_NOT_FOUND; + } + } FileAccess *src_f=NULL; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); @@ -733,9 +739,7 @@ bool EditorExportPlatformBB10::can_export(String *r_error) const { err+="Blackberry host tools not configured in editor settings.\n"; } - String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/"; - - if (!FileAccess::exists(exe_path+"bb10.zip")) { + if (!exists_export_template("bb10.zip")) { valid=false; err+="No export template found.\nDownload and install export templates.\n"; } |