From: Marcel Hollerbach Date: Mon, 11 Jul 2016 20:59:55 +0000 (+0200) Subject: ethumb: tell the user if the connection to the deamon failed X-Git-Tag: upstream/1.20.0~5183 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a393a90ccc18462b4886793109c3ca24fcc6b08e;p=platform%2Fupstream%2Fefl.git ethumb: tell the user if the connection to the deamon failed otherwise the user just gets no thumbnails, and no error message what actually happened. --- diff --git a/src/lib/ethumb_client/ethumb_client.c b/src/lib/ethumb_client/ethumb_client.c index 55b22f6..e5919f7 100644 --- a/src/lib/ethumb_client/ethumb_client.c +++ b/src/lib/ethumb_client/ethumb_client.c @@ -544,6 +544,17 @@ ethumb_client_shutdown(void) return _initcount; } +static void +_name_start(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pending *pending EINA_UNUSED) +{ + const char *name, *text; + if (eldbus_message_error_get(msg, &name, &text)) + { + ERR("Starting ethumb failed %s %s", name, text); + return; + } +} + /** * Connects to Ethumb server and return the client instance. * @@ -615,7 +626,12 @@ ethumb_client_connect(Ethumb_Client_Connect_Cb connect_cb, const void *data, Ein goto connection_err; } - eldbus_name_start(eclient->conn, _ethumb_dbus_bus_name, 0, NULL, NULL); + if (!eldbus_name_start(eclient->conn, _ethumb_dbus_bus_name, 0, _name_start, NULL)) + { + ERR("Failed to start ethumb bus"); + goto connection_err; + } + eldbus_name_owner_changed_callback_add(eclient->conn, _ethumb_dbus_bus_name, _ethumb_client_name_owner_changed, eclient, EINA_TRUE);