From ce9ac8b3d6cd8298481f556b8c6171cd7a3cfb6d Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 31 Mar 2023 14:25:37 +0800 Subject: [PATCH] ENH:display the correct author name on the project page Change-Id: I3ce5718b82cc6ae3ed4bf4e3e19673f790cd5788 --- src/slic3r/GUI/Project.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Project.cpp b/src/slic3r/GUI/Project.cpp index 57f43d13d..0a6635f9a 100644 --- a/src/slic3r/GUI/Project.cpp +++ b/src/slic3r/GUI/Project.cpp @@ -91,7 +91,25 @@ void ProjectPanel::on_reload(wxCommandEvent& evt) description = model.model_info->description; update_type = model.model_info->origin; - if (model.design_info != nullptr) + + try { + if (!model.model_info->copyright.empty()) { + json copy_right = json::parse(model.model_info->copyright); + + if (copy_right.is_array()) { + for (auto it = copy_right.begin(); it != copy_right.end(); it++) { + if ((*it).contains("author")) { + model_author = (*it)["author"].get(); + } + } + } + } + } + catch (...) { + ; + } + + if (model_author.empty() && model.design_info != nullptr) model_author = model.design_info->Designer; if (model.profile_info != nullptr) {