Enlightenment CVS committal Author : lordchaos Project : e17 Module : proto
Dir : e17/proto/entropy/src/plugins Modified Files: etk_list_viewer.c Log Message: * On filename, sort folders first =================================================================== RCS file: /cvsroot/enlightenment/e17/proto/entropy/src/plugins/etk_list_viewer.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -3 -r1.23 -r1.24 --- etk_list_viewer.c 27 Feb 2006 08:11:59 -0000 1.23 +++ etk_list_viewer.c 27 Feb 2006 08:25:56 -0000 1.24 @@ -83,15 +83,28 @@ /* Compares two rows of the tree */ static int _entropy_etk_list_filename_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data) { - char *row1_value, *row2_value; + gui_file *file1, *file2; + int val; if (!tree || !row1 || !row2 || !col) return 0; - - etk_tree_row_fields_get(row1, col, &row1_value, NULL); - etk_tree_row_fields_get(row2, col, &row2_value, NULL); - return strcmp(row1_value, row2_value); + file1 = ecore_hash_get(row_hash, row1); + file2 = ecore_hash_get(row_hash, row2); + + if (file1 && file2) { + val = strcmp(file1->file->filename, file2->file->filename); + + if ( !strcmp(file1->file->mime_type, "file/folder") && strcmp(file2->file->mime_type, "file/folder")) + return -1; + else if (!strcmp(file2->file->mime_type, "file/folder") && strcmp(file1->file->mime_type, "file/folder")) + return 1; + else + return val; + } else { + printf("Could not locate file!\n"); + return 0; + } } /* Compares two rows of the tree */ ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs