1
0
Fork 0

Per variant authors/description data.

Will only work once the catalogs(s) are updated, and needs a
corresponding SimGear update.
This commit is contained in:
James Turner 2016-11-25 22:45:48 +00:00
parent 14942f4e8b
commit 5db1f5cad6

View file

@ -743,12 +743,13 @@ QVariant AircraftItemModel::dataFromPackage(const PackageRef& item, const Delega
changedState.thumbnail = (role - AircraftThumbnailRole);
return packageThumbnail(item, changedState);
} else if (role == AircraftAuthorsRole) {
SGPropertyNode* authors = item->properties()->getChild("author");
if (authors) {
return QString::fromStdString(authors->getStringValue());
std::string authors = item->getLocalisedProp("author", state.variant);
if (!authors.empty()) {
return QString::fromStdString(authors);
}
} else if (role == AircraftLongDescriptionRole) {
return QString::fromStdString(item->description()).simplified();
std::string longDesc = item->getLocalisedProp("description", state.variant);
return QString::fromStdString(longDesc).simplified();
} else if (role == AircraftPackageSizeRole) {
return static_cast<int>(item->fileSizeBytes());
} else if (role == AircraftURIRole) {