If you use the code suggested in elementary/src/lib/elm_thumb_common.h ...
elm_thumb_ethumb_client_get will get a false because elm_need_ethumb is no
longer setting _elm_ethumb_client.  If you add:
if (!_elm_ethumb_client)
        _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
after ethumb_client_init in elm_need_ethumb on line 568, it works here.

Stephen



On Sun, Aug 4, 2013 at 9:19 PM, Daniel Juyung Seo <seojuyu...@gmail.com>wrote:

> Hello, raster can you check this commit again?
>
> It broke existing ethumb sample/apps.
>
> http://git.enlightenment.org/core/elementary.git/tree/src/examples/thumb_example_01.c
> This thumb example is broken after this commit and ephoto is not running
> due to this patch.
>
> Thanks in advance.
>
> Daniel Juyung Seo (SeoZ)
>
>
>
> On Thu, Jul 4, 2013 at 8:39 AM, Carsten Haitzler - Enlightenment Git <
> no-re...@enlightenment.org> wrote:
>
> > raster pushed a commit to branch master.
> >
> > commit 433a2c805ff768c08e6fa87c4e5e66466b3685b0
> > Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
> > Date:   Thu Jul 4 08:39:00 2013 +0900
> >
> >     ethumb - stop requesting ethumbd to start again every time it dies
> > ---
> >  src/lib/elm_icon.c  | 11 ++++----
> >  src/lib/elm_thumb.c | 76
> > ++++++++++++++++++++++++++++-------------------------
> >  2 files changed, 45 insertions(+), 42 deletions(-)
> >
> > diff --git a/src/lib/elm_icon.c b/src/lib/elm_icon.c
> > index 16b067a..652d384 100644
> > --- a/src/lib/elm_icon.c
> > +++ b/src/lib/elm_icon.c
> > @@ -620,17 +620,16 @@ _elm_icon_smart_add(Eo *obj, void *_pd, va_list
> > *list EINA_UNUSED)
> >  static void
> >  _elm_icon_smart_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
> >  {
> > -#ifdef HAVE_ELEMENTARY_ETHUMB
> > -   Ethumb_Client *ethumbd;
> > -#endif
> > -
> >     Elm_Icon_Smart_Data *sd = _pd;
> >
> >     if (sd->stdicon) eina_stringshare_del(sd->stdicon);
> >
> >  #ifdef HAVE_ELEMENTARY_ETHUMB
> > -   ethumbd = elm_thumb_ethumb_client_get();
> > -   _icon_thumb_stop(sd, ethumbd);
> > +   if (sd->thumb.request)
> > +     {
> > +        Ethumb_Client *ethumbd = elm_thumb_ethumb_client_get();
> > +        if (ethumbd) _icon_thumb_stop(sd, ethumbd);
> > +     }
> >
> >     eina_stringshare_del(sd->thumb.file.path);
> >     eina_stringshare_del(sd->thumb.file.key);
> > diff --git a/src/lib/elm_thumb.c b/src/lib/elm_thumb.c
> > index 906fae5..d615009 100644
> > --- a/src/lib/elm_thumb.c
> > +++ b/src/lib/elm_thumb.c
> > @@ -404,13 +404,47 @@ _thumbnailing_available_cb(void *data,
> >     return ECORE_CALLBACK_RENEW;
> >  }
> >
> > +static Eina_Bool _elm_need_ethumb = EINA_FALSE;
> > +static void _on_die_cb(void *, Ethumb_Client *);
> > +
> > +static void
> > +_connect_cb(void *data __UNUSED__,
> > +            Ethumb_Client *c,
> > +            Eina_Bool success)
> > +{
> > +   if (success)
> > +     {
> > +        ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL,
> > NULL);
> > +        _elm_ethumb_connected = EINA_TRUE;
> > +        ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL,
> NULL);
> > +     }
> > +   else
> > +     _elm_ethumb_client = NULL;
> > +}
> > +
> > +static void
> > +_on_die_cb(void *data __UNUSED__,
> > +           Ethumb_Client *c __UNUSED__)
> > +{
> > +   if (_elm_ethumb_client)
> > +     {
> > +        ethumb_client_disconnect(_elm_ethumb_client);
> > +        _elm_ethumb_client = NULL;
> > +     }
> > +   _elm_ethumb_connected = EINA_FALSE;
> > +   if (pending_request > 0)
> > +     _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL,
> NULL);
> > +}
> > +
> >  static void
> >  _thumb_show(Elm_Thumb_Smart_Data *sd)
> >  {
> >     Elm_Widget_Smart_Data *wd = eo_data_scope_get(sd->obj,
> > ELM_OBJ_WIDGET_CLASS);
> >     evas_object_show(wd->resize_obj);
> >
> > -   if (elm_thumb_ethumb_client_connected_get())
> > +   if (!_elm_ethumb_client)
> > +     _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL,
> NULL);
> > +   else if (elm_thumb_ethumb_client_connected_get())
> >       {
> >          _thumb_start(sd);
> >          return;
> > @@ -474,38 +508,6 @@ _elm_thumb_smart_hide(Eo *obj, void *_pd, va_list
> > *list EINA_UNUSED)
> >  #endif
> >  }
> >
> > -#ifdef ELM_ETHUMB
> > -static Eina_Bool _elm_need_ethumb = EINA_FALSE;
> > -static void _on_die_cb(void *, Ethumb_Client *);
> > -
> > -static void
> > -_connect_cb(void *data __UNUSED__,
> > -            Ethumb_Client *c,
> > -            Eina_Bool success)
> > -{
> > -   if (success)
> > -     {
> > -        ethumb_client_on_server_die_callback_set(c, _on_die_cb, NULL,
> > NULL);
> > -        _elm_ethumb_connected = EINA_TRUE;
> > -        ecore_event_add(ELM_ECORE_EVENT_ETHUMB_CONNECT, NULL, NULL,
> NULL);
> > -     }
> > -   else
> > -     _elm_ethumb_client = NULL;
> > -}
> > -
> > -static void
> > -_on_die_cb(void *data __UNUSED__,
> > -           Ethumb_Client *c __UNUSED__)
> > -{
> > -   ethumb_client_disconnect(_elm_ethumb_client);
> > -
> > -   _elm_ethumb_client = NULL;
> > -   _elm_ethumb_connected = EINA_FALSE;
> > -   _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
> > -}
> > -
> > -#endif
> > -
> >  void
> >  _elm_unneed_ethumb(void)
> >  {
> > @@ -513,8 +515,11 @@ _elm_unneed_ethumb(void)
> >     if (!_elm_need_ethumb) return;
> >     _elm_need_ethumb = EINA_FALSE;
> >
> > -   ethumb_client_disconnect(_elm_ethumb_client);
> > -   _elm_ethumb_client = NULL;
> > +   if (_elm_ethumb_client)
> > +     {
> > +        ethumb_client_disconnect(_elm_ethumb_client);
> > +        _elm_ethumb_client = NULL;
> > +     }
> >     ethumb_client_shutdown();
> >     ELM_ECORE_EVENT_ETHUMB_CONNECT = 0;
> >  #endif
> > @@ -561,7 +566,6 @@ elm_need_ethumb(void)
> >
> >     ELM_ECORE_EVENT_ETHUMB_CONNECT = ecore_event_type_new();
> >     ethumb_client_init();
> > -   _elm_ethumb_client = ethumb_client_connect(_connect_cb, NULL, NULL);
> >
> >     return EINA_TRUE;
> >  #else
> >
> > --
> >
> >
> >
> ------------------------------------------------------------------------------
> > This SF.net email is sponsored by Windows:
> >
> > Build for Windows Store.
> >
> > http://p.sf.net/sfu/windows-dev2dev
> >
>
> ------------------------------------------------------------------------------
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
>
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to