From ebdf34e81ae94f6a9956c41ca49fa77bedf3cfaf Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 30 Jul 2020 12:29:06 +0100 Subject: [PATCH] Launcher add-ons: tweak display of missing version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Show missing min/max FG version as ‘-‘ to avoid a translation headache. Thanks to Slawek Mikula for the suggestion. --- src/GUI/AddonsModel.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/GUI/AddonsModel.cxx b/src/GUI/AddonsModel.cxx index 4e4ff63d2..e65373133 100644 --- a/src/GUI/AddonsModel.cxx +++ b/src/GUI/AddonsModel.cxx @@ -111,7 +111,8 @@ QVariant AddonsModel::get(int idx, int role) const return path; } else if (role == VersionRole) { - return QString::fromStdString(addon->getVersion()->str()); + const auto v = addon->getVersion()->str(); + return QString::fromStdString(v); } else if (role == AuthorsRole) { QStringList authors; @@ -147,10 +148,16 @@ QVariant AddonsModel::get(int idx, int role) const return tags; } 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) { - return QString::fromStdString(addon->getMaxFGVersionRequired()); + const auto v = addon->getMaxFGVersionRequired(); + if (v == "none") + return QStringLiteral("-"); + return QString::fromStdString(v); } else if (role == HomePageRole) { return QUrl(QString::fromStdString(addon->getHomePage()));