If someone has the time, please take a look on my eio branch, I pushed the
code to use eio and get the files list ordered as expected.

On Wed, Sep 10, 2014 at 11:22 AM, Eduardo Lima (Etrunko) <[email protected]>
wrote:

> Yes, I have plans to change this function to use eio, but I still did not
> have the time to fix the issue of ordering the list of files to produce the
> same results as this first patch. If anyone interested, there is a work in
> progress in my eio branch.
>
> Cheers, Etrunko
>
> On Wed, Sep 10, 2014 at 6:12 AM, Cedric BAIL <[email protected]> wrote:
>
>> On Wed, Sep 10, 2014 at 10:13 AM, Sebastian Dransfeld
>> <[email protected]> wrote:
>> > Maybe we should deprecate the ecore_file_*() functions which are
>> > replaced by eina_file_*() functions? ecore_file_ls f.ex.
>>
>> Yes and depending on the use case, eio. Usually eina file operation do
>> consume less memory and do more efficient syscall.
>>
>> Cedric
>>
>> > On 09/09/2014 10:17 PM, Eduardo Lima (Etrunko) wrote:
>> >> etrunko pushed a commit to branch master.
>> >>
>> >>
>> http://git.enlightenment.org/apps/rage.git/commit/?id=7c80b9a131b729bd244b40c194dc36bf24dde661
>> >>
>> >> commit 7c80b9a131b729bd244b40c194dc36bf24dde661
>> >> Author: Eduardo Lima (Etrunko) <[email protected]>
>> >> Date:   Mon Aug 25 15:36:44 2014 -0300
>> >>
>> >>      dnd: Recurse into directories
>> >>
>> >>      Signed-off-by: Eduardo Lima (Etrunko) <[email protected]>
>> >> ---
>> >>   AUTHORS       |  1 +
>> >>   src/bin/dnd.c | 66
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++------
>> >>   2 files changed, 61 insertions(+), 6 deletions(-)
>> >>
>> >> diff --git a/AUTHORS b/AUTHORS
>> >> index b9a9404..230cb46 100644
>> >> --- a/AUTHORS
>> >> +++ b/AUTHORS
>> >> @@ -1 +1,2 @@
>> >>   Carsten Haitzler <[email protected]>
>> >> +Eduardo Lima (Etrunko) <[email protected]>
>> >> diff --git a/src/bin/dnd.c b/src/bin/dnd.c
>> >> index f8faba4..1a8b9d2 100644
>> >> --- a/src/bin/dnd.c
>> >> +++ b/src/bin/dnd.c
>> >> @@ -60,6 +60,39 @@ _escape_parse(const char *str)
>> >>      return dest;
>> >>   }
>> >>
>> >> +static Eina_Bool
>> >> +_recurse_dir(Evas_Object *win, const char *path)
>> >> +{
>> >> +   Eina_Bool ret = EINA_FALSE;
>> >> +   Eina_List *ls, *l;
>> >> +   char *p, *escape;
>> >> +   const char *full;
>> >> +
>> >> +   ls = ecore_file_ls(path);
>> >> +   EINA_LIST_FOREACH(ls, l, p)
>> >> +     {
>> >> +        escape = _escape_parse(p);
>> >> +        full = eina_stringshare_printf("%s/%s", path, escape);
>> >> +        free(escape);
>> >> +        if (ecore_file_is_dir(full))
>> >> +          {
>> >> +             ret = _recurse_dir(win, full);
>> >> +             eina_stringshare_del(full);
>> >> +             continue;
>> >> +          }
>> >> +
>> >> +        printf("inserting '%s'\n", full);
>> >> +        win_video_insert(win, full);
>> >> +        eina_stringshare_del(full);
>> >> +        ret = EINA_TRUE;
>> >> +     }
>> >> +
>> >> +   EINA_LIST_FREE(ls, p)
>> >> +     free(p);
>> >> +
>> >> +   return ret;
>> >> +}
>> >> +
>> >>   Eina_Bool
>> >>   _cb_drop(void *data, Evas_Object *o EINA_UNUSED, Elm_Selection_Data
>> *ev)
>> >>   {
>> >> @@ -94,8 +127,15 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED,
>> Elm_Selection_Data *ev)
>> >>                               tt = _escape_parse(tb);
>> >>                               if (tt)
>> >>                                 {
>> >> -                                 win_video_insert(win, tt);
>> >> -                                 inserted = EINA_TRUE;
>> >> +                                 if (ecore_file_is_dir(tt))
>> >> +                                   {
>> >> +                                      inserted = _recurse_dir(win,
>> tt);
>> >> +                                   }
>> >> +                                 else
>> >> +                                   {
>> >> +                                      win_video_insert(win, tt);
>> >> +                                      inserted = EINA_TRUE;
>> >> +                                   }
>> >>                                    free(tt);
>> >>                                 }
>> >>                            }
>> >> @@ -108,8 +148,15 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED,
>> Elm_Selection_Data *ev)
>> >>                               tt = _escape_parse(tb);
>> >>                               if (tt)
>> >>                                 {
>> >> -                                 win_video_insert(win, tt);
>> >> -                                 inserted = EINA_TRUE;
>> >> +                                 if (ecore_file_is_dir(tt))
>> >> +                                   {
>> >> +                                      inserted = _recurse_dir(win,
>> tt);
>> >> +                                   }
>> >> +                                 else
>> >> +                                   {
>> >> +                                      win_video_insert(win, tt);
>> >> +                                      inserted = EINA_TRUE;
>> >> +                                   }
>> >>                                    free(tt);
>> >>                                 }
>> >>                            }
>> >> @@ -124,8 +171,15 @@ _cb_drop(void *data, Evas_Object *o EINA_UNUSED,
>> Elm_Selection_Data *ev)
>> >>           char *tt = _escape_parse(ev->data);
>> >>           if (tt)
>> >>             {
>> >> -             win_video_insert(win, tt);
>> >> -             inserted = EINA_TRUE;
>> >> +             if (ecore_file_is_dir(tt))
>> >> +               {
>> >> +                  inserted = _recurse_dir(win, tt);
>> >> +               }
>> >> +             else
>> >> +               {
>> >> +                  win_video_insert(win, tt);
>> >> +                  inserted = EINA_TRUE;
>> >> +               }
>> >>                free(tt);
>> >>             }
>> >>        }
>> >>
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > Want excitement?
>> > Manually upgrade your production database.
>> > When you want reliability, choose Perforce
>> > Perforce version control. Predictably reliable.
>> >
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>> > _______________________________________________
>> > enlightenment-devel mailing list
>> > [email protected]
>> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>> >
>>
>>
>>
>> --
>> Cedric BAIL
>>
>>
>> ------------------------------------------------------------------------------
>> Want excitement?
>> Manually upgrade your production database.
>> When you want reliability, choose Perforce
>> Perforce version control. Predictably reliable.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
>> _______________________________________________
>> enlightenment-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>>
>
>
>
> --
> Eduardo de Barros Lima ◤✠◢
> [email protected]
>



-- 
Eduardo de Barros Lima ◤✠◢
[email protected]
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to