From a393a90ccc18462b4886793109c3ca24fcc6b08e Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 11 Jul 2016 22:59:55 +0200 Subject: [PATCH] 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. --- src/lib/ethumb_client/ethumb_client.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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); -- 2.7.4