Show fallback icon on missing country flag icon

If a country flag icon does not exist, we now display the globe icon, which
is being used for the continents as well.

This will vertically align the country name with the others that have an
icon.
This commit is contained in:
Jan Klass 2017-01-30 20:21:14 +01:00
parent 1be562fefb
commit 95c7b5e39c

View File

@ -435,8 +435,13 @@ QVariant ServerItem::data(int column, int role) const {
return loadIcon(QLatin1String("skin:emblems/emblem-favorite.svg"));
else if (itType == LANType)
return loadIcon(QLatin1String("skin:places/network-workgroup.svg"));
else if (! qsCountryCode.isEmpty())
return loadIcon(QString::fromLatin1(":/flags/%1.svg").arg(qsCountryCode));
else if (! qsCountryCode.isEmpty()) {
QString flag = QString::fromLatin1(":/flags/%1.svg").arg(qsCountryCode);
if (!QFileInfo::exists(flag)) {
flag = QLatin1String("skin:categories/applications-internet.svg");
}
return loadIcon(flag);
}
else
return loadIcon(QLatin1String("skin:categories/applications-internet.svg"));
}