ENH:display the correct author name on the project page

Change-Id: I3ce5718b82cc6ae3ed4bf4e3e19673f790cd5788
This commit is contained in:
tao wang 2023-03-31 14:25:37 +08:00 committed by Lane.Wei
parent 3c6e68553b
commit ce9ac8b3d6
1 changed files with 19 additions and 1 deletions

View File

@ -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<std::string>();
}
}
}
}
}
catch (...) {
;
}
if (model_author.empty() && model.design_info != nullptr)
model_author = model.design_info->Designer;
if (model.profile_info != nullptr) {