mmenu; fix for minor bug -- when 'do not show app in main cat, if it has subcats...
[pandora-libraries.git] / minimenu / mmcat.c
index a8c40a6..ab3e9d4 100644 (file)
@@ -539,7 +539,10 @@ unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco
   // so, is the cat we're looking at right now the apps main (or main alt) cat?
   if ( parentp ) {
     // and does this app have sub/altsub cats?
-    if ( app -> main_category1 || app -> main_category2 || app -> alt_category1 || app -> alt_category2 ) {
+    if ( ( parentp == 1 && ( app -> main_category1 || app -> main_category2 ) ) ||
+        ( parentp == 2 && ( app -> alt_category1 || app -> alt_category2 ) )
+       )
+    {
       // and we're only desiring the subcat version of the app?
       if ( pnd_conf_get_as_int_d ( g_conf, "tabs.subcat_to_parent", 1 ) == 0 ) {
        // create the parent category, since we need to be able to place a folder here maybe
@@ -785,6 +788,7 @@ void category_publish ( unsigned int filter_mask, char *param ) {
     } else if ( filter_mask == CFBYNAME ) {
       char *foo = strchr ( param, '*' ) + 1;
       if ( strncasecmp ( iter -> catname, param, strlen ( iter -> catname ) ) == 0 &&
+          iter -> parent_catname &&
           strcasecmp ( iter -> parent_catname, foo ) == 0 )
       {
        interested = 1;