fix for caching
authorskeezix <skeezix@flotsam-vm.(none)>
Thu, 15 Apr 2010 20:16:44 +0000 (16:16 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Thu, 15 Apr 2010 20:16:44 +0000 (16:16 -0400)
minimenu/mmcache.c

index bc98c68..4480a12 100644 (file)
@@ -240,29 +240,31 @@ unsigned char cache_icon ( pnd_disco_t *app, unsigned char maxwidth, unsigned ch
   } // ovr?
 
   // if this is a real pnd file (dir-app or pnd-file-app), then try to pull icon from there
-  if (  app -> object_flags & PND_DISCO_GENERATED ) {
+  if ( ! iconbuf ) {
 
-    // maybe we can discover this single-file and find an icon?
-    if ( strcasestr ( app -> object_filename, PND_PACKAGE_FILEEXT ) ) {
+    if (  app -> object_flags & PND_DISCO_GENERATED ) {
 
-      // looks like a pnd, now what do we do..
-      pnd_box_handle h = pnd_disco_file ( app -> object_path, app -> object_filename );
+      // maybe we can discover this single-file and find an icon?
+      if ( strcasestr ( app -> object_filename, PND_PACKAGE_FILEEXT ) ) {
 
-      if ( h ) {
-       pnd_disco_t *d = pnd_box_get_head ( h );
-       iconbuf = pnd_emit_icon_to_buffer ( d, &buflen );
-      }
+       // looks like a pnd, now what do we do..
+       pnd_box_handle h = pnd_disco_file ( app -> object_path, app -> object_filename );
 
-    } // filename has .pnd?
+       if ( h ) {
+         pnd_disco_t *d = pnd_box_get_head ( h );
+         iconbuf = pnd_emit_icon_to_buffer ( d, &buflen );
+       }
 
-  } else {
+      } // filename has .pnd?
 
-    // pull icon into buffer from .pnd if not already found an icon
-    if ( ! iconbuf ) {
+    } else {
+
+      // pull icon into buffer from .pnd if not already found an icon
       iconbuf = pnd_emit_icon_to_buffer ( app, &buflen );
-    }
 
-  } // generated?
+    } // generated?
+
+  } // already got icon?
 
   if ( ! iconbuf ) {
     return ( 0 );