summaryrefslogtreecommitdiff
path: root/platform/windows/export/export_plugin.cpp
diff options
context:
space:
mode:
authorFredia Huya-Kouadio <fhuya@fb.com>2022-08-14 19:26:22 -0700
committerGitHub <noreply@github.com>2022-08-14 19:26:22 -0700
commit5a8d786ef9dcfd5b206ec3eeb5e369930e773acc (patch)
tree2274723d72b9dabc2107a6cc87b86b22288c1d13 /platform/windows/export/export_plugin.cpp
parent128d68796d9f412a5b05cca8714f217341cfa376 (diff)
parent45c73775561808ccb2eb4a59927d9c59965e3d20 (diff)
Merge pull request #63122 from m4gr3d/split_can_export_main
Refactor the export checking logic to improve separation of concerns
Diffstat (limited to 'platform/windows/export/export_plugin.cpp')
-rw-r--r--platform/windows/export/export_plugin.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp
index febef5ad12..9d3ec31f73 100644
--- a/platform/windows/export/export_plugin.cpp
+++ b/platform/windows/export/export_plugin.cpp
@@ -412,15 +412,26 @@ Error EditorExportPlatformWindows::_code_sign(const Ref<EditorExportPreset> &p_p
return OK;
}
-bool EditorExportPlatformWindows::can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
+bool EditorExportPlatformWindows::has_valid_export_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const {
String err = "";
- bool valid = EditorExportPlatformPC::can_export(p_preset, err, r_missing_templates);
+ bool valid = EditorExportPlatformPC::has_valid_export_configuration(p_preset, err, r_missing_templates);
String rcedit_path = EditorSettings::get_singleton()->get("export/windows/rcedit");
if (p_preset->get("application/modify_resources") && rcedit_path.is_empty()) {
err += TTR("The rcedit tool must be configured in the Editor Settings (Export > Windows > Rcedit) to change the icon or app information data.") + "\n";
}
+ if (!err.is_empty()) {
+ r_error = err;
+ }
+
+ return valid;
+}
+
+bool EditorExportPlatformWindows::has_valid_project_configuration(const Ref<EditorExportPreset> &p_preset, String &r_error) const {
+ String err = "";
+ bool valid = true;
+
String icon_path = ProjectSettings::get_singleton()->globalize_path(p_preset->get("application/icon"));
if (!icon_path.is_empty() && !FileAccess::exists(icon_path)) {
err += TTR("Invalid icon path:") + " " + icon_path + "\n";