diff options
author | Jean Guyomarc'h <jean.guyomarch@openwide.fr> | 2016-08-26 15:43:16 +0200 |
---|---|---|
committer | Jean Guyomarc'h <jean@guyomarch.bzh> | 2016-08-26 21:16:39 +0200 |
commit | 92d3fc8f4ffec07668621e71c3ad5d6875fc06c2 (patch) | |
tree | bbdfd08f0f556cf62268870a96235cc6bf7d0997 | |
parent | 0874c4da3823ceae0dfcda44b0e0d5e6251e39a9 (diff) |
elementary: better error handling of fileselector
-rw-r--r-- | src/lib/elementary/elc_fileselector.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c index 8ed28947eb..ec30015fb3 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c | |||
@@ -772,7 +772,7 @@ _process_child_error_cb(void *data, Eina_Error err EINA_UNUSED) | |||
772 | efl_unref(it_data->model); | 772 | efl_unref(it_data->model); |
773 | free(it_data); | 773 | free(it_data); |
774 | 774 | ||
775 | WRN("could not get data from child Efl.Model"); | 775 | ERR("Failed to access to a model property"); |
776 | 776 | ||
777 | lreq->item_total--; | 777 | lreq->item_total--; |
778 | } | 778 | } |
@@ -831,8 +831,14 @@ _process_children_cb(void *data, void *values) | |||
831 | { | 831 | { |
832 | EINA_ACCESSOR_FOREACH(children_accessor, i, child) | 832 | EINA_ACCESSOR_FOREACH(children_accessor, i, child) |
833 | { | 833 | { |
834 | Eina_Promise *promises[7] = {NULL,}; | 834 | Eina_Promise *promises[7]; |
835 | Eina_Promise *promise_all = NULL; | 835 | Eina_Promise *promise_all = NULL; |
836 | const char *prop[6] = { | ||
837 | "path", "filename", "is_dir", "size", "mtime", "mime_type" | ||
838 | }; | ||
839 | unsigned int i; | ||
840 | Eina_Error error; | ||
841 | |||
836 | it_data = calloc(1, sizeof(Elm_Fileselector_Item_Data)); | 842 | it_data = calloc(1, sizeof(Elm_Fileselector_Item_Data)); |
837 | if (!it_data) | 843 | if (!it_data) |
838 | { | 844 | { |
@@ -843,12 +849,16 @@ _process_children_cb(void *data, void *values) | |||
843 | it_data->model = efl_ref(child); | 849 | it_data->model = efl_ref(child); |
844 | it_data->user_data = lreq; | 850 | it_data->user_data = lreq; |
845 | 851 | ||
846 | promises[0] = efl_model_property_get(child, "path"); | 852 | for (i = 0; i <= 5; i++) |
847 | promises[1] = efl_model_property_get(child, "filename"); | 853 | { |
848 | promises[2] = efl_model_property_get(child, "is_dir"); | 854 | promises[i] = efl_model_property_get(child, prop[i]); |
849 | promises[3] = efl_model_property_get(child, "size"); | 855 | error = eina_promise_error_get(promises[i]); |
850 | promises[4] = efl_model_property_get(child, "mtime"); | 856 | if (error) |
851 | promises[5] = efl_model_property_get(child, "mime_type"); | 857 | { |
858 | ERR("Error with property \"%s\": %s", prop[i], | ||
859 | eina_error_msg_get(error)); | ||
860 | } | ||
861 | } | ||
852 | promises[6] = NULL; | 862 | promises[6] = NULL; |
853 | 863 | ||
854 | promise_all = eina_promise_all(eina_carray_iterator_new((void**)promises)); | 864 | promise_all = eina_promise_all(eina_carray_iterator_new((void**)promises)); |