From 052a7a44fa5a6cca8a794ec290ffddd20391ab6b Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 30 May 2013 09:54:07 +0300 Subject: [PATCH 4/5] Emit "changed" signal when setting information from wtmp. --- src/daemon.c | 2 ++ src/user.c | 8 +++++++- src/user.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/daemon.c b/src/daemon.c index 02f2de3..ad0dd74 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -384,6 +384,8 @@ entry_generator_wtmp (GHashTable *users, g_object_set (user, "login-history", g_variant_new ("a(xxa{sv})", builder), NULL); g_variant_builder_unref (builder); g_list_free (accounting->previous_logins); + + user_changed (user); } g_hash_table_unref (login_hash); diff --git a/src/user.c b/src/user.c index e3f8e01..cf1dbff 100644 --- a/src/user.c +++ b/src/user.c @@ -505,6 +505,12 @@ user_unregister (User *user) g_dbus_interface_skeleton_unexport (G_DBUS_INTERFACE_SKELETON (user)); } +void +user_changed (User *user) +{ + accounts_user_emit_changed (ACCOUNTS_USER (user)); +} + User * user_new (Daemon *daemon, uid_t uid) @@ -728,7 +734,7 @@ user_change_email_authorized_cb (Daemon *daemon, g_object_notify (G_OBJECT (user), "email"); } - accounts_user_complete_set_email (ACCOUNTS_USER (user), context); + accounts_user_complete_set_email (ACCOUNTS_USER (user), context); } diff --git a/src/user.h b/src/user.h index 5c3c719..0848b50 100644 --- a/src/user.h +++ b/src/user.h @@ -64,6 +64,7 @@ void user_update_system_account_property (User *user, void user_register (User *user); void user_unregister (User *user); +void user_changed (User *user); void user_save (User *user); -- 1.8.1.4