aboutsummaryrefslogtreecommitdiff
path: root/src/session-dbus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/session-dbus.c')
-rw-r--r--src/session-dbus.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/session-dbus.c b/src/session-dbus.c
index fa9ea54..07cebf7 100644
--- a/src/session-dbus.c
+++ b/src/session-dbus.c
@@ -5,6 +5,7 @@ Copyright 2010 Canonical Ltd.
Authors:
Ted Gould <ted@canonical.com>
+ Conor Curran <conor.curran@canonical.com>
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License version 3, as published
@@ -28,7 +29,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "session-dbus.h"
#include "dbus-shared-names.h"
-static GVariant * get_icon (SessionDbus * service);
+static GVariant * get_users_real_name (SessionDbus * service);
static void bus_get_cb (GObject * object, GAsyncResult * res, gpointer user_data);
static void bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * method, GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data);
@@ -98,7 +99,7 @@ session_dbus_init (SessionDbus *self)
{
SessionDbusPrivate * priv = SESSION_DBUS_GET_PRIVATE(self);
- priv->name = g_strdup(ICON_DEFAULT);
+ priv->name = NULL;
priv->bus = NULL;
priv->bus_cancel = NULL;
priv->dbus_registration = 0;
@@ -163,8 +164,8 @@ bus_method_call (GDBusConnection * connection, const gchar * sender,
SessionDbus * service = SESSION_DBUS(user_data);
GVariant * retval = NULL;
- if (g_strcmp0(method, "GetIcon") == 0) {
- retval = get_icon(service);
+ if (g_strcmp0(method, "GetUserRealName") == 0) {
+ retval = get_users_real_name (service);
} else {
g_warning("Calling method '%s' on the indicator service and it's unknown", method);
}
@@ -214,10 +215,11 @@ session_dbus_finalize (GObject *object)
}
static GVariant *
-get_icon (SessionDbus * service)
+get_users_real_name (SessionDbus * service)
{
SessionDbusPrivate * priv = SESSION_DBUS_GET_PRIVATE(service);
- return g_variant_new("(s)", priv->name);
+ g_debug ("Get users real name: %s", priv->name);
+ return g_variant_new ("(s)", priv->name);
}
SessionDbus *
@@ -239,19 +241,18 @@ session_dbus_set_name (SessionDbus * session, const gchar * name)
if (priv->bus != NULL) {
g_dbus_connection_emit_signal (priv->bus,
- NULL,
- INDICATOR_SESSION_SERVICE_DBUS_OBJECT,
- INDICATOR_SESSION_SERVICE_DBUS_IFACE,
- "IconUpdated",
- g_variant_new ("(s)", priv->name, NULL),
- &error);
+ NULL,
+ INDICATOR_SESSION_SERVICE_DBUS_OBJECT,
+ INDICATOR_SESSION_SERVICE_DBUS_IFACE,
+ "UserRealNameUpdated",
+ g_variant_new ("(s)", priv->name, NULL),
+ &error);
if (error != NULL) {
- g_warning("Unable to send IconUpdated signal: %s", error->message);
+ g_warning("Unable to send UserRealNameUpdated signal: %s", error->message);
g_error_free(error);
return;
}
}
-
return;
}