]> git.openpandora.org Git - pandora-libraries.git/commitdiff
Added box-merge option for pnd_container, and added ability for mmenu to scan both
authorskeezix <skeezix@flotsam-vm.(none)>
Mon, 15 Mar 2010 20:15:42 +0000 (16:15 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Mon, 15 Mar 2010 20:15:42 +0000 (16:15 -0400)
menu and desktop application searchpaths

include/pnd_container.h
lib/pnd_container.c
minimenu/mmcat.c
minimenu/mmenu.c

index e16381dd6354bd39cac6e4ff2f3471a1a7646f79..d1c374f50f7c8d95407de366307c96dcc2447b3e 100644 (file)
@@ -44,6 +44,9 @@ void *pnd_box_allocinsert ( pnd_box_handle box, char *key, unsigned int size );
  */
 void *pnd_box_find_by_key ( pnd_box_handle box, char *key );
 
+/* merge two box lists */
+unsigned char pnd_box_append ( pnd_box_handle box, pnd_box_handle append );
+
 /* should the user want to walk around the container, a couple basic functions are
  * provided.
  */
index bf07a202b14675bc4ffded73c3187e6a052cb2ba..e08080a47f6c28a6b6429cb9b50b27149050b7f0 100644 (file)
@@ -175,3 +175,21 @@ unsigned int pnd_box_get_size ( pnd_box_handle box ) {
 
   return ( count );
 }
+
+unsigned char pnd_box_append ( pnd_box_handle box, pnd_box_handle append ) {
+  pnd_box_t *pbox = (pnd_box_t*) box;
+  pnd_box_t *pappend = (pnd_box_t*) append;
+
+  if ( pbox -> head ) {
+    pnd_box_node_t *n = pbox -> head;
+    while ( n -> next ) {
+      n = n -> next;
+    }
+    // by now, n -> next == NULL
+    n -> next = pappend -> head;
+  } else {
+    pbox -> head = pappend -> head;
+  }
+
+  return ( 1 );
+}
index d09cf0f7569ece2d36fdb543585ecbe5056d2417..eb63ad55d561f77e0a18eecc1b2db15b51c119de 100644 (file)
@@ -153,5 +153,7 @@ void category_freeall ( void ) {
 
   } // for
 
+  g_categorycount = 0;
+
   return;
 }
index 04a03ec3ef26d7afeede0e84e1126223e1955c0b..aadac02bb5520f56c836f618f3478ec10dcc9956 100644 (file)
@@ -295,8 +295,16 @@ void applications_scan ( void ) {
   ui_discoverscreen ( 1 /* clear screen */ );
 
   // determine current app list, cache icons
-  pnd_log ( pndn_debug, "Looking for pnd applications here: %s\n", pnd_conf_get_as_char ( g_desktopconf, "desktop.searchpath" ) );
-  g_active_apps = pnd_disco_search ( pnd_conf_get_as_char ( g_desktopconf, "desktop.searchpath" ), NULL ); // ignore overrides for now
+  // - ignore overrides for now
+  pnd_log ( pndn_debug, "Looking for pnd applications here: %s\n",
+           pnd_conf_get_as_char ( g_desktopconf, "desktop.searchpath" ) );
+  g_active_apps = pnd_disco_search ( pnd_conf_get_as_char ( g_desktopconf, "desktop.searchpath" ), NULL );
+  pnd_log ( pndn_debug, "Looking for pnd applications here: %s\n",
+           pnd_conf_get_as_char ( g_desktopconf, "menu.searchpath" ) );
+  pnd_box_handle menu_apps = pnd_disco_search ( pnd_conf_get_as_char ( g_desktopconf, "menu.searchpath" ), NULL );
+
+  pnd_box_append ( g_active_apps, menu_apps );
+
   g_active_appcount = pnd_box_get_size ( g_active_apps );
 
   unsigned char maxwidth, maxheight;