From: Daniel Juyung Seo Date: Sun, 29 Dec 2013 15:21:55 +0000 (+0900) Subject: test_fileselector: Added edje custom filter example to show the real use case of... X-Git-Tag: v1.9.0-alpha1~342 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a284a178375c26c64f6643519baec3bc57a9fa3;p=platform%2Fupstream%2Felementary.git test_fileselector: Added edje custom filter example to show the real use case of fileselector custom filter. This feature is really good. Thanks Ryuan! --- diff --git a/src/bin/test_fileselector.c b/src/bin/test_fileselector.c index aeae9b2..3af3089 100644 --- a/src/bin/test_fileselector.c +++ b/src/bin/test_fileselector.c @@ -482,6 +482,18 @@ _all_filter(const char *path EINA_UNUSED, return EINA_TRUE; } +static Eina_Bool +_edje_filter(const char *path, Eina_Bool dir, + void *data EINA_UNUSED) +{ + if (dir) return EINA_TRUE; + + if (eina_str_has_extension(path, ".edc") || + eina_str_has_extension(path, ".edj")) + return EINA_TRUE; + return EINA_FALSE; +} + void test_fileselector(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, @@ -523,6 +535,7 @@ test_fileselector(void *data EINA_UNUSED, elm_fileselector_mime_types_filter_append(fs, "text/*", "Text Files"); elm_fileselector_mime_types_filter_append(fs, "image/*", "Image Files"); elm_fileselector_custom_filter_append(fs, _all_filter, NULL, "All Files"); + elm_fileselector_custom_filter_append(fs, _edje_filter, NULL, "Edje Files"); evas_object_smart_callback_add(fs, "done", my_fileselector_done, win); evas_object_smart_callback_add(fs, "selected", my_fileselector_selected,