summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-11-19 00:35:04 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-11-19 00:35:04 -0300
commit068b177c125c6816d92afeac8216b9ae926803d3 (patch)
tree749c0c6cac23abd6dbc4e6022eeb016dbb1fd993 /tools
parenta0564efb657fa973e3facdbd383f2d064f92ca62 (diff)
parent31fa1bb8bd6b6ed3c9e8ebcae78d50482ccd9538 (diff)
Merge pull request #2292 from blackwc/can_export
Improve export validation
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/editor_import_export.cpp34
-rw-r--r--tools/editor/project_export.cpp2
2 files changed, 25 insertions, 11 deletions
diff --git a/tools/editor/editor_import_export.cpp b/tools/editor/editor_import_export.cpp
index e569485807..f52c6e67a2 100644
--- a/tools/editor/editor_import_export.cpp
+++ b/tools/editor/editor_import_export.cpp
@@ -1209,30 +1209,42 @@ bool EditorExportPlatformPC::can_export(String *r_error) const {
String exe_path = EditorSettings::get_singleton()->get_settings_path()+"/templates/";
- if (!FileAccess::exists(exe_path+debug_binary32) || !FileAccess::exists(exe_path+release_binary32)) {
+ if (use64 && (!FileAccess::exists(exe_path+debug_binary64) || !FileAccess::exists(exe_path+release_binary64))) {
valid=false;
- err="No 32 bits export templates found.\nDownload and install export templates.\n";
+ err="No 64 bits export templates found.\nDownload and install export templates.\n";
}
- if (!FileAccess::exists(exe_path+debug_binary64) || !FileAccess::exists(exe_path+release_binary64)) {
+
+ if (!use64 && (!FileAccess::exists(exe_path+debug_binary32) || !FileAccess::exists(exe_path+release_binary32))) {
valid=false;
- err="No 64 bits export templates found.\nDownload and install export templates.\n";
+ err="No 32 bits export templates found.\nDownload and install export templates.\n";
+ }
+
+ if(custom_debug_binary=="" && custom_release_binary=="") {
+ if (r_error) *r_error=err;
+ return valid;
}
+ bool dvalid = true;
+ bool rvalid = true;
- if (custom_debug_binary!="" && !FileAccess::exists(custom_debug_binary)) {
- valid=false;
- err+="Custom debug binary not found.\n";
+ if(!FileAccess::exists(custom_debug_binary)) {
+ dvalid = false;
+ err = "Custom debug binary not found.\n";
}
- if (custom_release_binary!="" && !FileAccess::exists(custom_release_binary)) {
- valid=false;
- err+="Custom release binary not found.\n";
+ if(!FileAccess::exists(custom_release_binary)) {
+ rvalid = false;
+ err = "Custom release binary not found.\n";
}
+ if (dvalid || rvalid)
+ valid = true;
+ else
+ valid = false;
+
if (r_error)
*r_error=err;
return valid;
-
}
diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp
index 30c7c9cfda..cd6dc06f75 100644
--- a/tools/editor/project_export.cpp
+++ b/tools/editor/project_export.cpp
@@ -193,6 +193,8 @@ void ProjectExportDialog::_prop_edited(String what) {
_save_export_cfg();
+ _validate_platform();
+
}
void ProjectExportDialog::_filters_edited(String what) {