Enlightenment CVS committal
Author : moom16
Project : e17
Module : proto
Dir : e17/proto/exhibit/src/bin
Modified Files:
exhibit_main.c
Log Message:
* Do not show hidden dirs and files
* Sort the dir tree (it needs to be done for the image tree too, but fork() is
the weirdest function I've ever seen...)
===================================================================
RCS file: /cvsroot/enlightenment/e17/proto/exhibit/src/bin/exhibit_main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- exhibit_main.c 19 Dec 2005 19:28:31 -0000 1.12
+++ exhibit_main.c 21 Dec 2005 20:04:31 -0000 1.13
@@ -2,6 +2,7 @@
#include <Ecore_File.h>
extern Evas_List *thumb_list;
+static int _ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1,
Etk_Tree_Row *row2, Etk_Tree_Col *col, void *data);
char *viewables[] =
{
@@ -202,6 +203,20 @@
_ex_main_populate_files(e);
}
+
+static int
+_ex_main_dtree_compare_cb(Etk_Tree *tree, Etk_Tree_Row *row1, Etk_Tree_Row
*row2, Etk_Tree_Col *col, void *data)
+{
+ char *dir1, *dir2;
+
+ if (!row1 || !row2 || !col)
+ return 0;
+
+ etk_tree_row_fields_get(row1, col, NULL, NULL, &dir1, NULL);
+ etk_tree_row_fields_get(row2, col, NULL, NULL, &dir2, NULL);
+ return strcmp(dir1, dir2);
+}
+
int
_ex_file_is_viewable(char *file)
{
@@ -259,7 +274,8 @@
pid_t pid;
Epsilon *ep;
- if (!strcmp(dir_entry->d_name, ".")||!strcmp(dir_entry->d_name, ".."))
+ /* Do not include hidden files */
+ if (dir_entry->d_name[0] == '.')
continue;
snprintf(image, PATH_MAX, "%s", dir_entry->d_name);
@@ -305,6 +321,7 @@
etk_tree_thaw(ETK_TREE(e->itree));
etk_tree_thaw(ETK_TREE(e->dtree));
+ etk_tree_sort(ETK_TREE(e->dtree), _ex_main_dtree_compare_cb, TRUE, e->dcol,
NULL);
}
void
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs