return ( NULL );
}
-unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep ) {
+unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep, unsigned char parentp ) {
mm_category_t *cat;
#if 0 // prepending
char catnamebuffer [ 512 ] = "";
}
}
+ // are we not putting apps into parent cat, when subcat is present? if so..
+ // if the cat we're looking at now is the main (or main alt-cat), and we also have a subcat, then ditch it.
+ // 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 )
+ {
+ // 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
+ category_push ( catname, parentcatname /* parent cat */, NULL /* app */, NULL /* ovrh */, NULL /* fspath */, visiblep );
+ // bail
+ return ( 1 );
+ } // subcat to parent?
+ } // app has subcat?
+ } // tab we're looking at now is the main tab?
+
// not default, just do it
category_push ( catname, parentcatname /* parent cat */, app, ovrh, NULL /* fspath */, visiblep );
interested = 1;
} // if
+ // desired tab?
if ( interested ) {
- // set us up the bomb; notice that we're just duplicating the pointers, not making
- // any new data here; none of this should ever be free'd!
- g_categories [ g_categorycount ] = iter;
- g_categorycount++;
- }
+
+ // lets only publish tabs that actually have an app in them .. just in case we've
+ // pruned out all the apps (sent them to Other or are suppressing apps in parent cats or
+ // something) at some point.
+ if ( iter -> fspath || iter -> refs ) {
+
+ // set us up the bomb; notice that we're just duplicating the pointers, not making
+ // any new data here; none of this should ever be free'd!
+ g_categories [ g_categorycount ] = iter;
+ g_categorycount++;
+
+ } // has apps?
+
+ } // interested?
// next
iter = pnd_box_get_next ( iter );
unsigned char category_map_setup ( void ); // set up the mappings
mm_category_t *category_map_query ( char *cat );
-unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep );
+unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep, unsigned char parentp );
// filesystem browser
unsigned char category_fs_restock ( mm_category_t *cat );
{ "Show directory browser tabs", "Show a tab for each SD card?", "0", "filesystem.do_browser", ct_boolean },
{ "Detail panel on start?", "Show or hide the detail panel when menu starts", "1", "display.show_detail_pane", ct_boolean },
{ "Sub-categories as folders?", "If no, uses tabs instead of folders within tabs.", "1", "tabs.subcat_as_folders", ct_boolean },
+ { "Sub-category apps in main cat?","If no, apps with subcategories are only in subcategories","1", "tabs.subcat_to_parent", ct_boolean },
{ "Start with app selected", "Whethor selection is placed by default or not", "0", "minimenu.start_selected", ct_boolean },
{ "Auto discover pnd apps?", "If no, turn on diectory browser to manually find apps", "1", "filesystem.do_pnd_disco", ct_boolean },
// dropped option -- we now strictly enforce free desktop categories (or user defined, but no more bogus PXML categories)
if ( iter -> unique_id && app_is_visible ( g_conf, iter -> unique_id ) ) {
// main categories
- category_meta_push ( iter -> main_category, NULL /* no parent cat */, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat", 1 ) );
- category_meta_push ( iter -> main_category1, iter -> main_category, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category1 ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat1", 0 ) );
- category_meta_push ( iter -> main_category2, iter -> main_category, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category2 ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat2", 0 ) );
+ category_meta_push ( iter -> main_category, NULL /* no parent cat */, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category ), 1);
+ category_meta_push ( iter -> main_category1, iter -> main_category, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category1 ), 0 );
+ category_meta_push ( iter -> main_category2, iter -> main_category, iter, ovrh, cat_is_visible ( g_conf, iter -> main_category2 ), 0 );
// alt categories
- category_meta_push ( iter -> alt_category, NULL /* no parent cat */, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat", 0 ) );
- category_meta_push ( iter -> alt_category1, iter -> alt_category, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category1 ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat1", 0 ) );
- category_meta_push ( iter -> alt_category2, iter -> alt_category, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category2 ) ); //pnd_conf_get_as_int_d ( g_conf, "tabs.top_altcat2", 0 ) );
+ category_meta_push ( iter -> alt_category, NULL /* no parent cat */, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category ), 1 );
+ category_meta_push ( iter -> alt_category1, iter -> alt_category, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category1 ), 0 );
+ category_meta_push ( iter -> alt_category2, iter -> alt_category, iter, ovrh, cat_is_visible ( g_conf, iter -> alt_category2 ), 0 );
} // app is visible?