Enlightenment CVS committal Author : ravenlock Project : e17 Module : apps/e
Dir : e17/apps/e/src/modules/conf_window_remembers Modified Files: e_int_config_remembers.c Log Message: Sort the list. =================================================================== RCS file: /cvs/e/e17/apps/e/src/modules/conf_window_remembers/e_int_config_remembers.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_int_config_remembers.c 13 May 2008 04:36:50 -0000 1.2 +++ e_int_config_remembers.c 13 May 2008 04:59:01 -0000 1.3 @@ -34,6 +34,39 @@ } /* private functions */ +static int +_cb_sort(void *data1, void *data2) +{ + E_Remember *rem1 = NULL; + E_Remember *rem2 = NULL; + const char *d1, *d2; + + rem1 = data1; + rem2 = data2; + if (!rem1) return 1; + if (!rem2) return -1; + + if (rem1->name) + d1 = rem1->name; + else if (rem1->class) + d1 = rem1->class; + else if (rem1->title) + d1 = rem1->title; + else if (rem1->role) + d1 = rem1->role; + + if (rem2->name) + d2 = rem2->name; + else if (rem2->class) + d2 = rem2->class; + else if (rem2->title) + d2 = rem2->title; + else if (rem2->role) + d2 = rem2->role; + + return strcmp(d1, d2); +} + static void * _create_data(E_Config_Dialog *cfd) { @@ -112,7 +145,7 @@ e_widget_ilist_freeze(cfdata->list); e_widget_ilist_clear(cfdata->list); - for (l = e_config->remembers; l; l = l->next) + for (l = evas_list_sort(e_config->remembers, -1, _cb_sort); l; l = l->next) { E_Remember *rem = NULL; ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs