aboutsummaryrefslogtreecommitdiff
path: root/src/session-service.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-03-18 13:48:42 -0500
committerTed Gould <ted@gould.cx>2010-03-18 13:48:42 -0500
commite6bf7bbff5e51b1c74a1e2f9c37c114d03b9c156 (patch)
tree91845d84ad73d6f0b4d2f567dc675d4a0f59ab0f /src/session-service.c
parente89ea26dff22aab414951f4a11c62848615ea74d (diff)
parenta4d38cd734039688c74db5244c7d751c0d4ec747 (diff)
downloadayatana-indicator-session-e6bf7bbff5e51b1c74a1e2f9c37c114d03b9c156.tar.gz
ayatana-indicator-session-e6bf7bbff5e51b1c74a1e2f9c37c114d03b9c156.tar.bz2
ayatana-indicator-session-e6bf7bbff5e51b1c74a1e2f9c37c114d03b9c156.zip
Using an icon for users or a stock item if they don't have an icon.
Diffstat (limited to 'src/session-service.c')
-rw-r--r--src/session-service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/session-service.c b/src/session-service.c
index fb20f3b..d2c2c74 100644
--- a/src/session-service.c
+++ b/src/session-service.c
@@ -590,6 +590,11 @@ rebuild_items (DbusmenuMenuitem *root,
dbusmenu_menuitem_property_set (mi, USER_ITEM_PROP_NAME, user->real_name);
}
dbusmenu_menuitem_property_set_bool (mi, USER_ITEM_PROP_LOGGED_IN, user->sessions != NULL);
+ if (user->icon_url != NULL && user->icon_url[0] != '\0' && g_str_has_prefix(user->icon_url, "file://")) {
+ dbusmenu_menuitem_property_set(mi, USER_ITEM_PROP_ICON, user->icon_url + strlen("file://"));
+ } else {
+ dbusmenu_menuitem_property_set(mi, USER_ITEM_PROP_ICON, USER_ITEM_ICON_DEFAULT);
+ }
dbusmenu_menuitem_child_append (root, mi);
g_signal_connect (G_OBJECT (mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK (activate_user_session), user);
}