Dont use system icon for clear search field icon

Fixes #413
This commit is contained in:
Jonas Kvinge
2020-04-27 00:24:49 +02:00
parent 2732536d6e
commit 627a2ef6dd
2 changed files with 11 additions and 8 deletions

View File

@@ -69,15 +69,17 @@ QIcon IconLoader::Load(const QString &name, const int size) {
if (IconMapper::iconmapper_.contains(name)) {
icon_prop = IconMapper::iconmapper_[name];
}
ret = QIcon::fromTheme(name);
if (ret.isNull()) {
for (QString alt_name : icon_prop.names) {
ret = QIcon::fromTheme(alt_name);
if (!ret.isNull()) break;
if (icon_prop.allow_system_icon) {
ret = QIcon::fromTheme(name);
if (ret.isNull()) {
for (QString alt_name : icon_prop.names) {
ret = QIcon::fromTheme(alt_name);
if (!ret.isNull()) break;
}
}
if (ret.isNull()) qLog(Warning) << "Couldn't load icon" << name << "from system theme icons.";
}
if (!ret.isNull()) return ret;
qLog(Warning) << "Couldn't load icon" << name << "from system theme icons.";
}
if (custom_icons_) {