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
This commit is contained in:
Axel Dörfler
2007-01-16 17:36:16 +00:00
parent 68fb266820
commit 8cddf19132
+7 -6
View File
@@ -386,8 +386,13 @@ IconCache::GetIconFromMetaMime(const char *fileType, IconDrawMode mode,
__FILE__, __LINE__, fileType)); __FILE__, __LINE__, fileType));
BMimeType mime(fileType); BMimeType mime(fileType);
char preferredAppSig[B_MIME_TYPE_LENGTH]; // try getting the icon directly from the metamime
if (mime.GetPreferredApp(preferredAppSig) == B_OK) { 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; SharedCacheEntry *aliasTo = 0;
if (entry) if (entry)
aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache); aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache);
@@ -409,10 +414,6 @@ IconCache::GetIconFromMetaMime(const char *fileType, IconDrawMode mode,
} }
} }
// try getting the icon directly from the metamime
if (mime.GetIcon(lazyBitmap->Get(), size) != B_OK)
return NULL;
BBitmap *bitmap = lazyBitmap->Adopt(); BBitmap *bitmap = lazyBitmap->Adopt();
if (!entry) { if (!entry) {
PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n", PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n",