After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 704426 - doesn't select the newly-created user
doesn't select the newly-created user
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: User Accounts
git master
Other All
: Normal normal
: ---
Assigned To: Ondrej Holy
Control-Center Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-17 21:58 UTC by Jonh Wendell
Modified: 2013-07-30 12:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.51 KB, patch)
2013-07-17 22:00 UTC, Jonh Wendell
committed Details | Review
proposed patch (3.05 KB, patch)
2013-07-29 17:36 UTC, Jonh Wendell
committed Details | Review
proposed patch, for 3.8 branch (2.38 KB, patch)
2013-07-29 17:45 UTC, Jonh Wendell
committed Details | Review

Description Jonh Wendell 2013-07-17 21:58:30 UTC
after creating a user, it's not being selected in the left panel.
Comment 1 Jonh Wendell 2013-07-17 22:00:03 UTC
Created attachment 249449 [details] [review]
proposed patch

proposed patch, it would be nice to have it on gnome-3-8 as well.
Comment 2 Ondrej Holy 2013-07-18 16:30:47 UTC
Review of attachment 249449 [details] [review]:

It looks good to me, so please commit to the both branches.
Comment 3 Jonh Wendell 2013-07-18 16:38:56 UTC
pushed, thanks.
Comment 4 Jonh Wendell 2013-07-29 17:35:25 UTC
turns out sometimes it still doesn't work, because we're getting almost empty 'User' objects after calling act_user_manager_create_user_finish():

(gdb) p *user
$5 = {parent = {g_type_instance = {g_class = 0x12afb50}, ref_count = 2, qdata = 0x0}, connection = 0xf55e60, accounts_proxy = 0x18290b0, object_proxy = 0x18001c0, 
  get_all_call = 0x0, object_path = 0x1811810 "/org/freedesktop/Accounts/User1003", uid = 0, user_name = 0x0, real_name = 0x0, password_hint = 0x0, home_dir = 0x0, 
  shell = 0x0, email = 0x0, location = 0x0, icon_file = 0x0, language = 0x0, x_session = 0x0, our_sessions = 0x0, other_sessions = 0x0, login_frequency = 0, login_time = 0, 
  login_history = 0x0, account_type = ACT_USER_ACCOUNT_TYPE_STANDARD, password_mode = ACT_USER_PASSWORD_MODE_REGULAR, uid_set = 0, is_loaded = 0, locked = 0, 
  automatic_login = 0, system_account = 0, local_account = 1, nonexistent = 0}

because the User object is filled asynchronously by accountsservice library.
so, with all those fields empty, any comparison with uid aor anything fails.

as a complement to the previous patch, I'm adding a new one, which connects to the 'is-loaded' signal of the User object. At this point the object is full loaded and thus it's safe to return it to the caller.
Comment 5 Jonh Wendell 2013-07-29 17:36:21 UTC
Created attachment 250388 [details] [review]
proposed patch
Comment 6 Jonh Wendell 2013-07-29 17:45:19 UTC
Created attachment 250390 [details] [review]
proposed patch, for 3.8 branch
Comment 7 Bastien Nocera 2013-07-30 12:35:50 UTC
Review of attachment 250388 [details] [review]:

That's fine as a bug fix, but I would really rather the libaccountsservice didn't tell us it's really finished until is-loaded was emitted on the service side.
So please file an upstream accountsservice bug as well and mention it in the commit message.

::: panels/user-accounts/um-account-dialog.c
@@ +203,3 @@
+  password = gtk_entry_get_text (GTK_ENTRY (self->local_password));
+  act_user_set_password_mode (user, self->local_password_mode);
+  if (self->local_password_mode == ACT_USER_PASSWORD_MODE_REGULAR) {

Remove braces for one-line conditionals.
Comment 8 Bastien Nocera 2013-07-30 12:36:26 UTC
Review of attachment 250390 [details] [review]:

Same comment as for the master patch.
Comment 9 Jonh Wendell 2013-07-30 12:55:19 UTC
thanks, Bastien.

I had filled a bug there, yesterday: https://bugs.freedesktop.org/show_bug.cgi?id=67483

But I was told, until some refactoring is done, this is the way to go.
Feel free to comment there as well, the bug is RESOLVED INVALID btw.