mmenu; fixed .desktop and pnd scans differing apps found; .desktop was missing /usr...
authorskeezix <skeezix@flotsam-vm.(none)>
Wed, 9 Nov 2011 21:26:04 +0000 (16:26 -0500)
committerskeezix <skeezix@flotsam-vm.(none)>
Wed, 9 Nov 2011 21:26:04 +0000 (16:26 -0500)
accidentally including bad categories, where pnd-scan filters them out. As of now, app listings between .desktop and pnd-scan should be more or less
the same, unless purposefully different through various nefarious means

include/pnd_desktop.h
include/pnd_discovery.h
lib/pnd_desktop.c
minimenu/mmenu.c
minimenu/mmui.c

index 6c8d0ab..3de5627 100644 (file)
@@ -16,7 +16,7 @@ extern "C" {
 unsigned char pnd_emit_dotdesktop ( char *targetpath, char *pndrun, pnd_disco_t *p );
 
 #define PND_DOTDESKTOP_LIBPND_ONLY 1 /* convenience flag; caller can do this himself as well */
-pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ); // sets object_flag CUSTOM1 for libpnd-origin
+pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ); // sets object_flag PND_DISCO_LIBPND_DD for libpnd-origin
 
 // emit_dotinfo() will spit out a .desktop 'info entry', similar to the way emit_dotdesktop does its thing
 // - rather than slide this into emit_dotdesktop(), we wish to allow apps to do this or not by calling this
index c241a94..00c93db 100644 (file)
@@ -44,8 +44,9 @@ typedef enum {
 // fetch the full PXML and get all the details. But I think we got out of control here :)
 // NOTE: We really need to rework disco-t so it can include non-english titles/desc; perhaps more info as optional,
 //   or a name/value pairing system so it can have extra data in it, without a complex structure.
-#define PND_DISCO_FLAG_OVR       // An ovr file was found for this app (not per subapp, just per .pnd)
+#define PND_DISCO_FLAG_OVR  1      // An ovr file was found for this app (not per subapp, just per .pnd)
 #define PND_DISCO_GENERATED 2      // This disco is 'faux', made up and not reflecting a real 'pnd file'
+#define PND_DISCO_LIBPND_DD 4      // This disco is from libpnd .desktop parsing
 #define PND_DISCO_CUSTOM1 (1<<30)  // An app may make use of this bitflag safely
 #define PND_DISCO_CUSTOM2 (1<<31)  // An app may make use of this bitflag safely
 typedef struct {
index e28b850..54e40a5 100644 (file)
@@ -937,7 +937,7 @@ pnd_disco_t *pnd_parse_dotdesktop ( char *ddpath, unsigned int flags ) {
     }
 
   } else {
-    p -> object_flags |= PND_DISCO_CUSTOM1; // so caller can do something if it wishes
+    p -> object_flags |= PND_DISCO_LIBPND_DD; // so caller can do something if it wishes
   }
 
   // filter on content
index 5946cc8..78b3683 100644 (file)
@@ -597,9 +597,10 @@ void applications_scan ( void ) {
   // perform app discovery on .desktop files?
   //
   if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.disco_dotdesktop", 0 ) ) {
-    char *chunks[5] = {
+    char *chunks[10] = {
       pnd_conf_get_as_char ( g_desktopconf, "desktop.dotdesktoppath" ),
       pnd_conf_get_as_char ( g_desktopconf, "menu.dotdesktoppath" ),
+      pnd_conf_get_as_char ( g_conf, "minimenu.aux_searchpath" ),
       //"/usr/share/applications",
       NULL
     };
@@ -639,8 +640,11 @@ void applications_scan ( void ) {
            snprintf ( ddpath, 1024, "%s/%s", chunks [ i ], de -> d_name );
            pnd_disco_t *p = pnd_parse_dotdesktop ( ddpath, flags );
            if ( p ) {
+             // store
              pnd_disco_t *ai = pnd_box_allocinsert ( g_active_apps, ddpath, sizeof(pnd_disco_t) );
              memmove ( ai, p, sizeof(pnd_disco_t) );
+             // free
+             free ( p );
            }
          }
 
@@ -673,9 +677,16 @@ void applications_scan ( void ) {
   while ( iter ) {
     //pnd_log ( pndn_debug, "  App: '%s'\n", IFNULL(iter->title_en,"No Name") );
 
+    // dump
+#if 0
+    printf ( "App %s\t%s\t Cat %s:%s:%s %s:%s:%s\n", iter -> title_en, iter -> unique_id,
+            iter -> main_category, iter -> main_category1, iter -> main_category2,
+            iter -> alt_category, iter -> alt_category1, iter -> alt_category2 );
+#endif
+
     // update cachescreen
-    // ... every 5 filenames, just to avoid slowing it too much
-    if ( loadlater == 0 && itercount % 5 == 0 ) {
+    // ... every 10 filenames, just to avoid slowing it too much
+    if ( loadlater == 0 && itercount % 10 == 0 ) {
       ui_cachescreen ( 0 /* clear screen */, IFNULL(iter->title_en,"No Name") );
     }
 
@@ -725,7 +736,7 @@ void applications_scan ( void ) {
       // OR its a .desktop and we've got a path
       // THEN go try to cache/load the icon
       if ( ( iter -> pnd_icon_pos ) ||
-          ( iter -> icon && iter -> object_flags & PND_DISCO_CUSTOM1 )
+          ( iter -> icon && iter -> object_flags & PND_DISCO_LIBPND_DD )
         )
       {
 
index 052c5e7..31a3e88 100644 (file)
@@ -2879,7 +2879,7 @@ unsigned char ui_threaded_defered_icon ( void *p ) {
 
     // has an icon that is not already cached?
     if ( ( iter -> pnd_icon_pos ) ||
-        ( iter -> icon && iter -> object_flags & PND_DISCO_CUSTOM1 )
+        ( iter -> icon && iter -> object_flags & PND_DISCO_LIBPND_DD )
        )
     {
   
@@ -4351,7 +4351,6 @@ char *ui_pick_custom_category ( unsigned char mode ) {
 }
 
 void ui_start_defered_icon_thread ( void ) {
-
   if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_icons_later", 0 ) == 0 ) {
     return;
   }