diff options
author | Robert Ancell <robert.ancell@canonical.com> | 2011-10-06 11:36:41 +1100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2011-10-06 11:36:41 +1100 |
commit | 94233c9965a89c526599e628abe5e5af002bc93b (patch) | |
tree | 825b805a1518135193d0dd65b2b3c7590dd1d337 /liblightdm-gobject/user.c | |
parent | 6262762b98c556a1cd9138b61e45e075f40e443f (diff) | |
download | lightdm-94233c9965a89c526599e628abe5e5af002bc93b.tar.gz |
Merge in changes from stable branch
Diffstat (limited to 'liblightdm-gobject/user.c')
-rw-r--r-- | liblightdm-gobject/user.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/liblightdm-gobject/user.c b/liblightdm-gobject/user.c index d43760dc..a6779fbc 100644 --- a/liblightdm-gobject/user.c +++ b/liblightdm-gobject/user.c @@ -19,13 +19,15 @@ #include "lightdm/user.h" -enum { +enum +{ LIST_PROP_0, LIST_PROP_NUM_USERS, LIST_PROP_USERS, }; -enum { +enum +{ USER_PROP_0, USER_PROP_NAME, USER_PROP_REAL_NAME, @@ -38,7 +40,8 @@ enum { USER_PROP_LOGGED_IN }; -enum { +enum +{ USER_ADDED, USER_CHANGED, USER_REMOVED, @@ -46,7 +49,8 @@ enum { }; static guint list_signals[LAST_LIST_SIGNAL] = { 0 }; -enum { +enum +{ CHANGED, LAST_USER_SIGNAL }; @@ -900,7 +904,8 @@ lightdm_user_list_get_property (GObject *object, self = LIGHTDM_USER_LIST (object); - switch (prop_id) { + switch (prop_id) + { case LIST_PROP_NUM_USERS: g_value_set_int (value, lightdm_user_list_get_length (self)); break; @@ -1102,7 +1107,15 @@ load_dmrc (LightDMUser *user) if (priv->session) g_free (priv->session); + /* The Language field is actually a locale, strip the codeset off it to get the language */ priv->language = g_key_file_get_string (priv->dmrc_file, "Desktop", "Language", NULL); + if (priv->language) + { + gchar *codeset = strchr (priv->language, '.'); + if (codeset) + *codeset = '\0'; + } + priv->layout = g_key_file_get_string (priv->dmrc_file, "Desktop", "Layout", NULL); priv->session = g_key_file_get_string (priv->dmrc_file, "Desktop", "Session", NULL); } @@ -1118,12 +1131,14 @@ get_string_property (GDBusProxy *proxy, const gchar *property) answer = g_dbus_proxy_get_cached_property (proxy, property); - if (!answer) { + if (!answer) + { g_warning ("Could not get accounts property %s", property); return NULL; } - if (!g_variant_is_of_type (answer, G_VARIANT_TYPE ("s"))) { + if (!g_variant_is_of_type (answer, G_VARIANT_TYPE ("s"))) + { g_warning ("Unexpected accounts property type for %s: %s", property, g_variant_get_type_string (answer)); g_variant_unref (answer); @@ -1145,8 +1160,10 @@ load_accounts_service (LightDMUser *user) /* First, find AccountObject proxy */ UserAccountObject *account = NULL; GList *iter; - for (iter = list_priv->user_account_objects; iter; iter = iter->next) { - if (((UserAccountObject *)iter->data)->user == user) { + for (iter = list_priv->user_account_objects; iter; iter = iter->next) + { + if (((UserAccountObject *)iter->data)->user == user) + { account = (UserAccountObject *)iter->data; break; } @@ -1281,7 +1298,8 @@ lightdm_user_get_property (GObject *object, self = LIGHTDM_USER (object); - switch (prop_id) { + switch (prop_id) + { case USER_PROP_NAME: g_value_set_string (value, lightdm_user_get_name (self)); break; |