From 8cddf1913200209f1489fda193cfe235c0b204cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= <axeld@pinc-software.de> Date: Tue, 16 Jan 2007 17:36:16 +0000 Subject: [PATCH] Tracker now prefers an icon coming directly from the MIME type over one specified by the application - as FileTypes already did. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19829 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/IconCache.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/kits/tracker/IconCache.cpp b/src/kits/tracker/IconCache.cpp index a0d811741c..b0fde2fbbc 100644 --- a/src/kits/tracker/IconCache.cpp +++ b/src/kits/tracker/IconCache.cpp @@ -386,8 +386,13 @@ IconCache::GetIconFromMetaMime(const char *fileType, IconDrawMode mode, __FILE__, __LINE__, fileType)); BMimeType mime(fileType); - char preferredAppSig[B_MIME_TYPE_LENGTH]; - if (mime.GetPreferredApp(preferredAppSig) == B_OK) { + // try getting the icon directly from the metamime + if (mime.GetIcon(lazyBitmap->Get(), size) != B_OK) { + // try getting it from the preferred app of this type + char preferredAppSig[B_MIME_TYPE_LENGTH]; + if (mime.GetPreferredApp(preferredAppSig) != B_OK) + return NULL; + SharedCacheEntry *aliasTo = 0; if (entry) aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache); @@ -408,11 +413,7 @@ IconCache::GetIconFromMetaMime(const char *fileType, IconDrawMode mode, return aliasTo; } } - - // try getting the icon directly from the metamime - if (mime.GetIcon(lazyBitmap->Get(), size) != B_OK) - return NULL; - + BBitmap *bitmap = lazyBitmap->Adopt(); if (!entry) { PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n",