From ce3c6c979630c638f3ad0c85928880357c7b0b75 Mon Sep 17 00:00:00 2001 From: Lukasz Skalski Date: Tue, 8 Oct 2013 15:51:41 +0200 Subject: [PATCH] Removed g_kdbus_get_sender() function. Fixed bus_unique_name set up. --- gio/gdbusconnection.c | 6 ++++-- gio/gkdbus.c | 15 +++------------ gio/gkdbus.h | 2 -- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index 02e6a4c..ca9808b 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -1649,9 +1649,11 @@ g_dbus_connection_send_message_unlocked (GDBusConnection *connection, goto out; if (G_IS_KDBUS_CONNECTION (connection->stream)){ - if(g_kdbus_get_sender(g_kdbus_connection_get_kdbus (G_KDBUS_CONNECTION (connection->stream))) != NULL) + if ((connection->bus_unique_name) != NULL) { - g_dbus_message_set_sender(message, g_kdbus_get_sender(g_kdbus_connection_get_kdbus (G_KDBUS_CONNECTION (connection->stream)))); + //g_print ("SENDER: %s\n", g_kdbus_get_sender(g_kdbus_connection_get_kdbus(G_KDBUS_CONNECTION (connection->stream)))); + //g_print ("SENDER CONNECTION: %s\n",g_dbus_connection_get_unique_name(connection)); + g_dbus_message_set_sender(message, connection->bus_unique_name); #ifdef KDBUS_DEBUG g_print (" KDBUS_DEBUG: (%s()): set_sender ok!\n",__FUNCTION__); #endif diff --git a/gio/gkdbus.c b/gio/gkdbus.c index 8853f77..d2c8617 100644 --- a/gio/gkdbus.c +++ b/gio/gkdbus.c @@ -708,18 +708,8 @@ g_kdbus_receive (GKdbus *kdbus, } /* - * g_kdbus_get_sender: - * - */ -gchar* -g_kdbus_get_sender (GKdbus *kdbus) -{ - return kdbus->priv->sender; -} - -/* * g_kdbus_send_reply: - * TODO: Handle errors + * TODO: Handle errors,remove unused variables */ static gboolean g_kdbus_send_reply (GDBusWorker *worker, @@ -751,7 +741,8 @@ g_kdbus_send_reply (GDBusWorker *worker, g_print ("g_kdbus_send_reply: sender set to:%s! \n", kdbus->priv->sender); #endif - g_dbus_message_set_body(reply, g_variant_new ("(s)", unique_name)); + //g_dbus_message_set_body(reply, g_variant_new ("(s)", unique_name)); + g_dbus_message_set_body (reply, g_variant_new ("(s)",sender)); _g_dbus_worker_queue_or_deliver_received_message (worker, reply); return TRUE; } diff --git a/gio/gkdbus.h b/gio/gkdbus.h index e21e91d..45b3f68 100644 --- a/gio/gkdbus.h +++ b/gio/gkdbus.h @@ -101,8 +101,6 @@ gssize g_kdbus_send_message (GDBusWorker *worker GLIB_AVAILABLE_IN_ALL gboolean g_kdbus_register (GKdbus *kdbus); GLIB_AVAILABLE_IN_ALL -gchar* g_kdbus_get_sender (GKdbus *kdbus); -GLIB_AVAILABLE_IN_ALL GSource * g_kdbus_create_source (GKdbus *kdbus, GIOCondition condition, GCancellable *cancellable); -- 2.7.4