if ( ( v = pnd_conf_get_as_char ( ovrh, key ) ) ) {
if ( p -> main_category1 ) {
free ( p -> main_category1 );
+ p -> main_category1 = NULL;
+ }
+ if ( strcasecmp ( v, "NoSubcategory" ) != 0 ) {
+ p -> main_category1 = strdup ( v );
}
- p -> main_category1 = strdup ( v );
}
} // got ovr conf loaded?
freedesktop_cat_t *freedesktop_category_query ( char *name, char *parentcatname ) {
freedesktop_cat_t *p = freedesktop_complete;
+ // if we're supplied "NoSubcategory" virtual name, then we set it to NULL for the search
+#if 0
+ if ( parentcatname && strcasecmp ( name, freedesktop_complete [ 2 ].cat ) == 0 ) {
+ name = parentcatname;
+ parentcatname = NULL;
+ }
+#endif
+
+ // search for the cat/parent combination
while ( p -> cat ) {
if ( strcasecmp ( p -> cat, name ) == 0 ) {
}
// check if category came from an ovr-file; if so, we implicitly trust it instead of enforcing rules
- if ( app -> object_flags & ( PND_DISCO_CUSTOM1 | PND_DISCO_CUSTOM1 ) ) {
+ if ( app -> object_flags & ( PND_DISCO_CUSTOM1 | PND_DISCO_CUSTOM2 ) ) {
goto category_done_audit;
}
// 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 ( 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
if ( ui_menu_twoby ( confirm, "B/enter; other to cancel", "Confirm categorization", "Do not set category" ) == 1 ) {
ovr_replace_or_add ( a, "maincategory", opts [ sel ] );
rescan_apps++;
+ // when changing main cat, reset subcat, otherwise you go from Game/Emu to Network/Emu and get sent to Other right away
+ ovr_replace_or_add ( a, "maincategorysub1", freedesktop_complete [ 2 ].cat );
}
}
unsigned char i;
i = 0;
+ opts [ optmax++ ] = freedesktop_complete [ 2 ].cat;
+
while ( 1 ) {
if ( ! freedesktop_complete [ i ].cat ) {
break;
}
- if ( freedesktop_complete [ i ].parent_cat ) {
+ char *whichparentarewe;
+ if ( g_categories [ ui_category ] -> parent_catname ) {
+ whichparentarewe = g_categories [ ui_category ] -> parent_catname;
+ } else {
+ whichparentarewe = g_categories [ ui_category ] -> catname;
+ }
+
+ if ( ( freedesktop_complete [ i ].parent_cat ) &&
+ ( strcasecmp ( freedesktop_complete [ i ].parent_cat, whichparentarewe ) == 0 )
+ )
+ {
opts [ optmax++ ] = freedesktop_complete [ i ].cat;
}