aboutsummaryrefslogtreecommitdiff
path: root/src/session-dbus.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-07-13 13:12:00 +0100
committerConor Curran <conor.curran@canonical.com>2011-07-13 13:12:00 +0100
commit1967b9c58fd2727733fb38c10d610eb80e365ae3 (patch)
tree1329ac1894461ecb93960122fbbca5cb400a01d6 /src/session-dbus.c
parent8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e (diff)
downloadayatana-indicator-session-1967b9c58fd2727733fb38c10d610eb80e365ae3.tar.gz
ayatana-indicator-session-1967b9c58fd2727733fb38c10d610eb80e365ae3.tar.bz2
ayatana-indicator-session-1967b9c58fd2727733fb38c10d610eb80e365ae3.zip
tidied up signals and methods for the session service so as the users real name should be available and not the icon, icon should not change on the panel
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;
}