From 15f6d3cebf9e8c9288132454816f1152e16dde36 Mon Sep 17 00:00:00 2001 From: est31 Date: Mon, 30 Nov 2015 01:26:51 +0100 Subject: 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 --- platform/bb10/export/export.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'platform/bb10/export/export.cpp') diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp index 434aaff41..2acd920f3 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"; } -- cgit v1.2.3-70-g09d2