Enlightenment CVS committal
Author : titan
Project : e17
Module : proto
Dir : e17/proto/ephoto/src
Modified Files:
ephoto_misc.c
Log Message:
Prevents user from segving if you file_ls a nonexistent dir heh :)
===================================================================
RCS file: /cvs/e/e17/proto/ephoto/src/ephoto_misc.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ephoto_misc.c 6 Apr 2006 20:21:09 -0000 1.9
+++ ephoto_misc.c 7 Apr 2006 02:37:19 -0000 1.10
@@ -258,25 +258,27 @@
ewl_object_maximum_size_set(EWL_OBJECT(tree), 200, 215);
ewl_widget_show(tree);
- slideshows = ecore_file_ls(homepath);
+
+ if ( ecore_file_is_dir(homepath) ) {
+ slideshows = ecore_file_ls(homepath);
+
+ while ( !ecore_list_is_empty(slideshows) ) {
+ char *tempo;
+ tempo = ecore_list_remove_first(slideshows);
- while ( !ecore_list_is_empty(slideshows) ) {
- char *tempo;
- tempo = ecore_list_remove_first(slideshows);
-
- rtext = ewl_text_new();
- ewl_widget_name_set(rtext, tempo);
- ewl_text_text_set(EWL_TEXT(rtext), tempo);
- ewl_object_minimum_size_set(EWL_OBJECT(rtext), 10, 16);
- ewl_object_fill_policy_set(EWL_OBJECT(rtext),
EWL_FLAG_FILL_ALL);
- ewl_widget_show(rtext);
-
- children[0] = rtext;
- children[1] = NULL;
- row = ewl_tree_row_add(EWL_TREE(tree), NULL, children);
- ewl_callback_append(rtext, EWL_CALLBACK_CLICKED,
loadclicked_cb, NULL);
+ rtext = ewl_text_new();
+ ewl_widget_name_set(rtext, tempo);
+ ewl_text_text_set(EWL_TEXT(rtext), tempo);
+ ewl_object_minimum_size_set(EWL_OBJECT(rtext), 10, 16);
+ ewl_object_fill_policy_set(EWL_OBJECT(rtext),
EWL_FLAG_FILL_ALL);
+ ewl_widget_show(rtext);
+
+ children[0] = rtext;
+ children[1] = NULL;
+ row = ewl_tree_row_add(EWL_TREE(tree), NULL, children);
+ ewl_callback_append(rtext, EWL_CALLBACK_CLICKED,
loadclicked_cb, NULL);
+ }
}
-
m->otext = ewl_text_new();
ewl_container_child_append(EWL_CONTAINER(vbox), m->otext);
ewl_object_alignment_set(EWL_OBJECT(m->otext), EWL_FLAG_ALIGN_CENTER);
@@ -358,8 +360,7 @@
}
fclose(file_ptr);
- ewl_widget_destroy(m->load_win);
}
-
+ ewl_widget_destroy(m->load_win);
}
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs