[gnome-control-center] user-accounts: Add um_user_is_local_account() method
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] user-accounts: Add um_user_is_local_account() method
- Date: Sat, 18 Aug 2012 18:15:50 +0000 (UTC)
commit 251a189cfc47b38df14e4ca515f0643973d08668
Author: Stef Walter <stefw gnome org>
Date: Tue Aug 14 18:33:30 2012 +0200
user-accounts: Add um_user_is_local_account() method
* Use new LocalAccount property in accountsservice to
add the um_user_is_local_account() method.
https://bugzilla.gnome.org/show_bug.cgi?id=681770
panels/user-accounts/um-user.c | 12 ++++++++++++
panels/user-accounts/um-user.h | 1 +
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/panels/user-accounts/um-user.c b/panels/user-accounts/um-user.c
index f027754..479b132 100644
--- a/panels/user-accounts/um-user.c
+++ b/panels/user-accounts/um-user.c
@@ -63,6 +63,7 @@ typedef struct {
gboolean locked;
gboolean automatic_login;
gboolean system_account;
+ gboolean local_account;
} UserProperties;
static void
@@ -145,6 +146,9 @@ user_properties_get (GDBusConnection *bus,
else if (strcmp (key, "SystemAccount") == 0) {
g_variant_get (value, "b", &props->system_account);
}
+ else if (strcmp (key, "LocalAccount") == 0) {
+ g_variant_get (value, "b", &props->local_account);
+ }
else if (strcmp (key, "PasswordMode") == 0) {
g_variant_get (value, "i", &props->password_mode);
}
@@ -679,6 +683,14 @@ um_user_is_system_account (UmUser *user)
return user->props->system_account;
}
+gboolean
+um_user_is_local_account (UmUser *user)
+{
+ g_return_val_if_fail (UM_IS_USER (user), FALSE);
+
+ return user->props->local_account;
+}
+
const gchar *
um_user_get_object_path (UmUser *user)
{
diff --git a/panels/user-accounts/um-user.h b/panels/user-accounts/um-user.h
index 8f78957..6ee7bdb 100644
--- a/panels/user-accounts/um-user.h
+++ b/panels/user-accounts/um-user.h
@@ -69,6 +69,7 @@ const gchar *um_user_get_icon_file (UmUser *user);
gboolean um_user_get_locked (UmUser *user);
gboolean um_user_get_automatic_login (UmUser *user);
gboolean um_user_is_system_account (UmUser *user);
+gboolean um_user_is_local_account (UmUser *user);
void um_user_set_user_name (UmUser *user,
const gchar *user_name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]