Hi again,

First patch is always a bad patch, here is the good one.
Sorry

--
Soulou

On Thu, 2011-05-12 at 13:47 +0200, Soulou wrote:
> Hi,
> 
> This is my first patch, it's just to handle
> ECORE_CONN_EVENT_SERVER_ERROR in the google plugin in order to see
> what's wrong, because I don't find why the plugin isn't working.
> 
> Thanks, 
> 
> --
> Soulou

Index: src/plugins/yahoo/yahoo.c
===================================================================
--- src/plugins/yahoo/yahoo.c	(revision 58278)
+++ src/plugins/yahoo/yahoo.c	(working copy)
@@ -239,6 +239,7 @@
    static Eina_Bool
 _server_data(void *data, int type, void *event)
 {
+	printf("ahahaha\n");
    Instance *inst;
    Ecore_Con_Event_Server_Data *ev;
 
Index: src/plugins/google/google.c
===================================================================
--- src/plugins/google/google.c	(revision 58278)
+++ src/plugins/google/google.c	(working copy)
@@ -12,6 +12,7 @@
 static void _code_updated(EWeather *eweather);
 static Eina_Bool _server_add(void *data, int type, void *event);
 static Eina_Bool _server_del(void *data, int type, void *event);
+static Eina_Bool _server_error(void *data, int type, void *event);
 static Eina_Bool _server_data(void *data, int type, void *event);
 static Eina_Bool _weather_cb_check(void *data);
 static EWeather_Type _weather_type_get(const char* id);
@@ -60,6 +61,7 @@
    Ecore_Event_Handler *add_handler;
    Ecore_Event_Handler *del_handler;
    Ecore_Event_Handler *data_handler;
+   Ecore_Event_Handler *error_handler;
    Ecore_Timer *check_timer;
 
    char *buffer, *location;
@@ -97,6 +99,9 @@
    inst->data_handler =
       ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA,
 	    _server_data, inst);
+   inst->error_handler =
+	   ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ERROR,
+		_server_error, inst);
 
    inst->check_timer =
       ecore_timer_add(0, _weather_cb_check, inst);
@@ -113,6 +118,7 @@
    if (inst->check_timer) ecore_timer_del(inst->check_timer);
    if (inst->add_handler) ecore_event_handler_del(inst->add_handler);
    if (inst->data_handler) ecore_event_handler_del(inst->data_handler);
+   if (inst->error_handler) ecore_event_handler_del(inst->error_handler);
    if (inst->del_handler) ecore_event_handler_del(inst->del_handler);
    if (inst->server) ecore_con_server_del(inst->server);
 
@@ -225,6 +231,23 @@
 }
 
    static Eina_Bool
+_server_error(void *data, int type, void *event)
+{
+   Instance *inst;
+   Ecore_Con_Event_Server_Error *ev;
+
+   if ((!inst->server) || (inst->server != ev->server)) return EINA_TRUE;
+
+   inst = data;
+   ev = event;
+
+   fprintf(stderr, "Connection error to %s : %s\n", 
+      ecore_con_server_name_get(inst->server) ,ev->error);
+
+   return EINA_FALSE;
+}
+
+   static Eina_Bool
 _server_data(void *data, int type, void *event)
 {
    Instance *inst;
------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to