mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-13 13:18:43 +02:00
Do not show empty or irrelevant information in mod details tab
This commit is contained in:
parent
065a8d5fcf
commit
75a1a0938f
@ -199,11 +199,21 @@ CModListView::~CModListView()
|
||||
|
||||
static QString replaceIfNotEmpty(QVariant value, QString pattern)
|
||||
{
|
||||
if(value.canConvert<QStringList>())
|
||||
return pattern.arg(value.toStringList().join(", "));
|
||||
|
||||
if(value.canConvert<QString>())
|
||||
return pattern.arg(value.toString());
|
||||
{
|
||||
if (value.toString().isEmpty())
|
||||
return "";
|
||||
else
|
||||
return pattern.arg(value.toString());
|
||||
}
|
||||
|
||||
if(value.canConvert<QStringList>())
|
||||
{
|
||||
if (value.toStringList().isEmpty())
|
||||
return "";
|
||||
else
|
||||
return pattern.arg(value.toStringList().join(", "));
|
||||
}
|
||||
|
||||
// all valid types of data should have been filtered by code above
|
||||
assert(!value.isValid());
|
||||
@ -264,6 +274,9 @@ QStringList CModListView::getModNames(QStringList input)
|
||||
|
||||
auto mod = modStateModel->getMod(modID);
|
||||
|
||||
if (mod.isHidden())
|
||||
continue;
|
||||
|
||||
QString displayName = mod.getName();
|
||||
if (displayName.isEmpty())
|
||||
displayName = modID.toLower();
|
||||
|
Loading…
x
Reference in New Issue
Block a user