1
0
Fork 0

Launcher add-ons: tweak display of missing version

Show missing min/max FG version as ‘-‘ to avoid a translation headache.
Thanks to Slawek Mikula for the suggestion.
This commit is contained in:
James Turner 2020-07-30 12:29:06 +01:00
parent d6b7eaf60f
commit ebdf34e81a

View file

@ -111,7 +111,8 @@ QVariant AddonsModel::get(int idx, int role) const
return path; return path;
} }
else if (role == VersionRole) { else if (role == VersionRole) {
return QString::fromStdString(addon->getVersion()->str()); const auto v = addon->getVersion()->str();
return QString::fromStdString(v);
} }
else if (role == AuthorsRole) { else if (role == AuthorsRole) {
QStringList authors; QStringList authors;
@ -147,10 +148,16 @@ QVariant AddonsModel::get(int idx, int role) const
return tags; return tags;
} }
else if (role == MinFGVersionRole) { else if (role == MinFGVersionRole) {
return QString::fromStdString(addon->getMinFGVersionRequired()); const auto v = addon->getMinFGVersionRequired();
if (v == "none")
return QStringLiteral("-");
return QString::fromStdString(v);
} }
else if (role == MaxFGVersionRole) { else if (role == MaxFGVersionRole) {
return QString::fromStdString(addon->getMaxFGVersionRequired()); const auto v = addon->getMaxFGVersionRequired();
if (v == "none")
return QStringLiteral("-");
return QString::fromStdString(v);
} }
else if (role == HomePageRole) { else if (role == HomePageRole) {
return QUrl(QString::fromStdString(addon->getHomePage())); return QUrl(QString::fromStdString(addon->getHomePage()));