Commit ef052149 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use QIcon::fromTheme instead of KIconLoader

This is not only more concise but also works better on highdpi
parent a4e35cb5
......@@ -387,14 +387,7 @@ QIcon CTTask::commandIcon() const
QMimeType mimeType = QMimeDatabase().mimeTypeForUrl(commandPath);
// logDebug() << mimeType->name();
if (mimeType.name() == QLatin1String("application/x-executable") || mimeType.name() == QLatin1String("application/octet-stream")) {
// The next line is identical as SmallIcon(commandPath.fileName()), but is able to return a isNull() QPixmap
QPixmap pixmap =
KIconLoader::global()->loadIcon(commandPath.fileName(), KIconLoader::Small, 0, KIconLoader::DefaultState, QStringList(), nullptr, true);
if (pixmap.isNull()) {
return QIcon::fromTheme(QLatin1String("system-run"));
}
return QIcon(pixmap);
return QIcon::fromTheme(commandPath.fileName(), QIcon::fromTheme(QLatin1String("system-run")));
}
return QIcon::fromTheme(mimeType.iconName());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment