From a803529b13a3dc2a04c7afc6134831f2179e72a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 19 Jan 2007 20:59:37 +0000 Subject: [PATCH] As Marcus noticed, some icons were gone after my last change; in fact no icons were shown for all files without an own icon, and without one from its MIME type. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19866 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/tracker/IconCache.cpp | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/kits/tracker/IconCache.cpp b/src/kits/tracker/IconCache.cpp index b0fde2fbbc..d111c8d04f 100644 --- a/src/kits/tracker/IconCache.cpp +++ b/src/kits/tracker/IconCache.cpp @@ -393,27 +393,30 @@ IconCache::GetIconFromMetaMime(const char *fileType, IconDrawMode mode, if (mime.GetPreferredApp(preferredAppSig) != B_OK) return NULL; - SharedCacheEntry *aliasTo = 0; + SharedCacheEntry *aliasTo = NULL; if (entry) aliasTo = (SharedCacheEntry *)entry->ResolveIfAlias(&fSharedCache); + // look for icon defined by preferred app from metamime aliasTo = (SharedCacheEntry *)GetIconForPreferredApp(fileType, preferredAppSig, mode, size, lazyBitmap, aliasTo); - if (aliasTo) { - // make an aliased entry so that the next time we get a - // hit on the first FindItem in here - if (!entry) { - PRINT_ADD_ITEM(("File %s; Line %d # adding entry as alias for type %s\n", - __FILE__, __LINE__, fileType)); - entry = fSharedCache.AddItem(&aliasTo, fileType); - entry->SetAliasFor(&fSharedCache, aliasTo); - } - ASSERT(aliasTo->HaveIconBitmap(mode, size)); - return aliasTo; + if (aliasTo == NULL) + return NULL; + + // make an aliased entry so that the next time we get a + // hit on the first FindItem in here + if (!entry) { + PRINT_ADD_ITEM(("File %s; Line %d # adding entry as alias for type %s\n", + __FILE__, __LINE__, fileType)); + entry = fSharedCache.AddItem(&aliasTo, fileType); + entry->SetAliasFor(&fSharedCache, aliasTo); } + ASSERT(aliasTo->HaveIconBitmap(mode, size)); + return aliasTo; } + // at this point, we've found an icon for the MIME type BBitmap *bitmap = lazyBitmap->Adopt(); if (!entry) { PRINT_ADD_ITEM(("File %s; Line %d # adding entry for type %s\n",