unsigned char category_meta_push ( char *catname, char *parentcatname, pnd_disco_t *app, pnd_conf_handle ovrh, unsigned char visiblep ) {
mm_category_t *cat;
+#if 0 // prepending
char catnamebuffer [ 512 ] = "";
+#endif
if ( ! catname ) {
return ( 1 ); // fine, just nada
} // good cats only?
// if invisible, and a parent category name is known, prepend it for ease of use
+#if 0 // prepending
if ( ! visiblep && parentcatname ) {
snprintf ( catnamebuffer, 500, "%s.%s", parentcatname, catname );
catname = catnamebuffer;
}
+#endif
// do we honour cat mapping at all?
if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_on", 0 ) ) {
case SDL_USEREVENT:
// update something
+ // the user-defined SDL events are all for threaded/delayed previews (and icons, which
+ // generally are not used); if we're in wide mode, we can skip previews
+ // to avoid slowing things down when they're not shown.
+
if ( event.user.code == sdl_user_ticker ) {
+ if ( ui_detail_hidden ) {
+ break; // skip building previews when not showing them
+ }
+
// timer went off, time to load something
if ( pnd_conf_get_as_int_d ( g_conf, "minimenu.load_previews_later", 0 ) ) {
char *labels [ 500 ];
unsigned int labelmax = 0;
unsigned int i;
+ char fulllabel [ 200 ];
if ( ! category_count ( CFHIDDEN ) ) {
return; // nothing to do
// build up labels to show in menu
for ( i = 0; i < g_categorycount; i++ ) {
- labels [ labelmax++ ] = g_categories [ i ] -> catname;
+
+ if ( g_categories [ i ] -> parent_catname ) {
+ sprintf ( fulllabel, "%s [%s]", g_categories [ i ] -> catname, g_categories [ i ] -> parent_catname );
+ } else {
+ sprintf ( fulllabel, "%s", g_categories [ i ] -> catname );
+ }
+
+ labels [ labelmax++ ] = strdup ( fulllabel );
}
// show menu
render_mask |= CHANGED_CATEGORY;
}
+ for ( i = 0; i < g_categorycount; i++ ) {
+ free ( labels [ i ] );
+ }
+
return;
}