mirror of
https://github.com/transmission/transmission.git
synced 2026-02-14 23:19:34 +00:00
fix: mime-type icons on Windows (#8443)
* fix: mime-type icons on Windows * fixup! fix: mime-type icons on Windows use file_icon_ as the fallback icon do not mark the temp string as translatable --------- Co-authored-by: Mike Gelfand <mikedld@users.noreply.github.com>
This commit is contained in:
@@ -84,21 +84,10 @@ QIcon IconCache::getMimeTypeIcon(QString const& mime_type_name, bool multifile)
|
||||
|
||||
if (!multifile)
|
||||
{
|
||||
QMimeDatabase const mime_db;
|
||||
static auto const mime_db = QMimeDatabase{};
|
||||
auto const type = mime_db.mimeTypeForName(mime_type_name);
|
||||
icon = getThemeIcon(type.iconName());
|
||||
|
||||
if (icon.isNull())
|
||||
{
|
||||
icon = getThemeIcon(type.genericIconName());
|
||||
}
|
||||
|
||||
if (icon.isNull())
|
||||
{
|
||||
icon = file_icon_;
|
||||
}
|
||||
|
||||
return icon;
|
||||
auto const filename = QStringLiteral("filename.%1").arg(type.preferredSuffix());
|
||||
return guessMimeIcon(filename, file_icon_);
|
||||
}
|
||||
|
||||
auto const mime_icon = getMimeTypeIcon(mime_type_name, false);
|
||||
|
||||
Reference in New Issue
Block a user