From 95c7b5e39cc7f569ea9c2f8aebb5e3b964380eb3 Mon Sep 17 00:00:00 2001 From: Jan Klass Date: Mon, 30 Jan 2017 20:21:14 +0100 Subject: [PATCH] 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. --- src/mumble/ConnectDialog.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mumble/ConnectDialog.cpp b/src/mumble/ConnectDialog.cpp index d4ba2f209..64d466f64 100644 --- a/src/mumble/ConnectDialog.cpp +++ b/src/mumble/ConnectDialog.cpp @@ -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")); }