eio: implement efl_io_manager_xattr_ls
authorCedric BAIL <cedric@osg.samsung.com>
Wed, 7 Sep 2016 23:20:52 +0000 (16:20 -0700)
committerCedric BAIL <cedric@osg.samsung.com>
Thu, 8 Sep 2016 22:16:43 +0000 (15:16 -0700)
src/lib/eio/efl_io_manager.c

index c3c0809..fba276c 100644 (file)
@@ -405,32 +405,28 @@ _efl_io_manager_stat(Eo *obj,
 
 static Efl_Future *
 _efl_io_manager_xattr_ls(Eo *obj,
-                         Efl_Io_Manager_Data *pd,
+                         Efl_Io_Manager_Data *pd EINA_UNUSED,
                          const char *path)
 {
-   // FIXME
-#if 0
-   Eina_Promise_Owner *promise = eina_promise_add();
-   Job_Closure *operation_data = _job_closure_create(obj, pd, promise);
+   Efl_Promise *p;
+   Eio_File *h;
 
-   Eina_Promise* p = eina_promise_owner_promise_get(promise);
-   if (!operation_data)
-     {
-        EINA_LOG_CRIT("Failed to create eio job operation data.");
-        eina_promise_owner_error_set(promise, eina_error_get());
-        eina_error_set(0);
-        return p;
-     }
+   p = efl_add(EFL_PROMISE_CLASS, obj);
+   if (!p) return NULL;
+
+   h = _eio_file_xattr(path,
+                       _file_string_cb,
+                       _file_done_cb,
+                       _file_error_cb,
+                       p);
+   if (!h) goto end;
 
-   operation_data->delayed_arg = (char*)calloc(sizeof(char), strlen(path) + 1);
-   strcpy(operation_data->delayed_arg, path);
+   efl_event_callback_array_add(p, promise_progress_handling(), h);
+   return efl_promise_future_get(p);
 
-   eina_promise_owner_progress_notify(promise,
-      _xattr_notify_start,
-      operation_data,
-      _free_notify_start_data);
-   return p;
-#endif
+ end:
+   efl_del(p);
+   return NULL;
 }
 
 static Efl_Future *