Enlightenment CVS committal Author : rephorm Project : e17 Module : proto
Dir : e17/proto/e_dbus/src/lib/notification Modified Files: client.c Log Message: pass errors along in callbacks =================================================================== RCS file: /cvs/e/e17/proto/e_dbus/src/lib/notification/client.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- client.c 11 Jul 2007 00:46:21 -0000 1.2 +++ client.c 11 Jul 2007 00:46:37 -0000 1.3 @@ -35,17 +35,14 @@ cb_notify(void *data, DBusMessage *msg, DBusError *err) { E_DBus_Callback *cb; - E_Notification_Return_Notify *ret; - - if (dbus_error_is_set(err)) - { - fprintf (stderr, "an error occurred: %s\n", err->message); - return; - } + E_Notification_Return_Notify *ret = NULL; cb = data; if (!cb) return; - ret = e_notify_unmarshal_notify_return(msg); - e_dbus_callback_call(cb, ret); + + if (!dbus_error_is_set(err)) + ret = e_notify_unmarshal_notify_return(msg); + + e_dbus_callback_call(cb, ret, err); } void @@ -65,16 +62,14 @@ cb_get_capabilities(void *data, DBusMessage *msg, DBusError *err) { E_DBus_Callback *cb; - E_Notification_Return_Get_Capabilities *ret; - if (dbus_error_is_set(err)) - { - fprintf (stderr, "an error occurred: %s\n", err->message); - return; - } + E_Notification_Return_Get_Capabilities *ret = NULL; cb = data; if (!cb) return; - ret = e_notify_unmarshal_get_capabilities_return(msg); - e_dbus_callback_call(cb, ret); + + if (!dbus_error_is_set(err)) + ret = e_notify_unmarshal_get_capabilities_return(msg); + + e_dbus_callback_call(cb, ret, err); } void @@ -92,15 +87,14 @@ cb_get_server_information(void *data, DBusMessage *msg, DBusError *err) { E_DBus_Callback *cb; - E_Notification_Return_Get_Server_Information *ret; - if (dbus_error_is_set(err)) - { - fprintf (stderr, "an error occurred: %s\n", err->message); - return; - } + E_Notification_Return_Get_Server_Information *ret = NULL; cb = data; - ret = e_notify_unmarshal_get_server_information_return(msg); - e_dbus_callback_call(cb, ret); + if (!cb) return; + + if (!dbus_error_is_set(err)) + ret = e_notify_unmarshal_get_server_information_return(msg); + + e_dbus_callback_call(cb, ret, err); } void ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs