}
- return ( strcmp ( s1 -> ref -> title_en, s2 -> ref -> title_en ) );
+ return ( strcasecmp ( s1 -> ref -> title_en, s2 -> ref -> title_en ) );
}
void category_dump ( void ) {
// merge lists
if ( merge_apps ) {
if ( g_active_apps ) {
+ // the key from pnd_disco_search() is the _path_, so easy to look for duplicates
+ // this is pretty inefficient, being linked lists; perhaps should switch to hash tables when
+ // we expect thousands of apps.. or at least an index or something.
+ void *a = pnd_box_get_head ( merge_apps );
+ void *nexta = NULL;
+ while ( a ) {
+ nexta = pnd_box_get_next ( a );
+
+ // if the key for the node is also found in active apps, toss out the merging one
+ if ( pnd_box_find_by_key ( g_active_apps, pnd_box_get_key ( a ) ) ) {
+ //fprintf ( stderr, "Merging app id '%s' is duplicate; discarding it.\n", pnd_box_get_key ( a ) );
+ pnd_box_delete_node ( merge_apps, a );
+ }
+
+ a = nexta;
+ }
+
// got menu apps, and got desktop apps, merge
pnd_box_append ( g_active_apps, merge_apps );
} else {
// merge aux apps
if ( merge_apps ) {
if ( g_active_apps ) {
+
+ // LAME: snipped from above; should just catenate the 3 sets of searchpaths into a
+ // master searchpath, possibly removing duplicate paths _then_, and keep all this much
+ // more efficient
+
+ // the key from pnd_disco_search() is the _path_, so easy to look for duplicates
+ // this is pretty inefficient, being linked lists; perhaps should switch to hash tables when
+ // we expect thousands of apps.. or at least an index or something.
+ void *a = pnd_box_get_head ( merge_apps );
+ void *nexta = NULL;
+ while ( a ) {
+ nexta = pnd_box_get_next ( a );
+
+ // if the key for the node is also found in active apps, toss out the merging one
+ if ( pnd_box_find_by_key ( g_active_apps, pnd_box_get_key ( a ) ) ) {
+ fprintf ( stderr, "Merging app id '%s' is duplicate; discarding it.\n", pnd_box_get_key ( a ) );
+ pnd_box_delete_node ( merge_apps, a );
+ }
+
+ a = nexta;
+ }
+
pnd_box_append ( g_active_apps, merge_apps );
} else {
g_active_apps = merge_apps;
// base searchpath to locate the conf
#define MMENU_CONF "mmenu.conf"
-#define MMENU_CONF_SEARCHPATH "/media/*/pandora/mmenu:/etc/pandora/conf:./minimenu"
+#define MMENU_CONF_SEARCHPATH "/media/*/pandora/mmenu:/media/*/pandora/appdata/mmenu:/etc/pandora/conf:./minimenu"
typedef enum {
pndn_debug = 0,
if ( isalpha ( event.key.keysym.sym ) && g_categories [ ui_category ].refcount > 0 ) {
mm_appref_t *app = g_categories [ ui_category ].refs;
- // walk the category, looking for a first-char match
- while ( app ) {
- if ( app -> ref -> title_en && toupper ( app -> ref -> title_en [ 0 ] ) == toupper ( event.key.keysym.sym ) ) {
- break;
+ //fprintf ( stderr, "sel %s next %s\n", ui_selected -> ref -> title_en, ui_selected -> next -> ref -> title_en );
+
+ // are we already matching the same char? and next item is also same char?
+ if ( app && ui_selected &&
+ ui_selected -> ref -> title_en && ui_selected -> next -> ref -> title_en &&
+ toupper ( ui_selected -> ref -> title_en [ 0 ] ) == toupper ( ui_selected -> next -> ref -> title_en [ 0 ] ) &&
+ toupper ( ui_selected -> ref -> title_en [ 0 ] ) == toupper ( event.key.keysym.sym )
+ )
+ {
+ // just skip down one
+ app = ui_selected -> next;
+ } else {
+
+ // walk the category, looking for a first-char match
+ while ( app ) {
+ if ( app -> ref -> title_en && toupper ( app -> ref -> title_en [ 0 ] ) == toupper ( event.key.keysym.sym ) ) {
+ break;
+ }
+ app = app -> next;
}
- app = app -> next;
- }
+
+ } // same start letter, or new run?
// found something, or no?
if ( app ) {
ui_set_selected ( ui_selected );
}
+
+
+
+
} // SDLK_alphanumeric?
} // SDLK_....
# Desktop configuration
[desktop]
-searchpath /mnt/sd?/pandora/desktop:./testdata/app? # path to depth-search for PXMLs and pnd-files
+searchpath /media/*/pandora/desktop:./testdata/app? # path to depth-search for PXMLs and pnd-files
dotdesktoppath ./testdata/dotdesktop # path for pndnotifyd to spit .desktop files into
iconpath ./testdata/doticons # path for pndnotifyd to drop icons into (can be same as dotdesktoppath if WM permits)
[menu]
-searchpath /mnt/sd?/pandora/menu:./testdata/menuapps # path to depth-search for PXMLs and pnd-files
+searchpath /media/*/pandora/menu:./testdata/app?:./testdata/menuapps # path to depth-search for PXMLs and pnd-files
dotdesktoppath ./testdata/menu # path for pndnotifyd to spit .desktop files into
iconpath ./testdata/menuicons # path for pndnotifyd to drop icons into (can be same as dotdesktoppath if WM permits)