Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_filelist_tree.c Log Message: use ecore_list_sort =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_filelist_tree.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- ewl_filelist_tree.c 23 Aug 2007 05:26:51 -0000 1.18 +++ ewl_filelist_tree.c 29 Oct 2007 18:50:22 -0000 1.19 @@ -335,10 +335,6 @@ ewl_filelist_tree_data_sort(void *data, unsigned int column __UNUSED__, Ewl_Sort_Direction sort) { - char *file; - unsigned int count; - Ecore_Sheap *sorttmp; - int (*list_add)(Ecore_List *list, void *data); Ewl_Filelist_Tree_Data *td = data; DENTER_FUNCTION(DLEVEL_STABLE); @@ -346,25 +342,13 @@ if (sort == EWL_SORT_DIRECTION_NONE) DRETURN(DLEVEL_STABLE); - /* Similar to ecore_file_ls, sort using a temporary heap. */ - count = ecore_list_count(td->files); - sorttmp = ecore_sheap_new(ECORE_COMPARE_CB(strcmp), count); - - /* Remove from list and push into sorted heap */ - while ((file = ecore_list_first_remove(td->files))) - ecore_sheap_insert(sorttmp, file); - - /* Handle sort order by switching between append and prepend */ + /* Handle the correct sort order */ if (sort == EWL_SORT_DIRECTION_ASCENDING) - list_add = ecore_list_append; + ecore_list_sort(td->files, ECORE_COMPARE_CB(strcoll), + ECORE_SORT_MIN); else - list_add = ecore_list_prepend; - - /* Remove from heap in sorted order and add to list */ - while ((file = ecore_sheap_extract(sorttmp))) - list_add(td->files, file); - - ecore_sheap_destroy(sorttmp); + ecore_list_sort(td->files, ECORE_COMPARE_CB(strcoll), + ECORE_SORT_MAX); DLEAVE_FUNCTION(DLEVEL_STABLE); } ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs