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 698234 - If one put only one name for fullname, login combobox proposes twice the same name
If one put only one name for fullname, login combobox proposes twice the same...
Status: RESOLVED FIXED
Product: gnome-initial-setup
Classification: Applications
Component: general
0.8
Other Linux
: Normal normal
: ---
Assigned To: GNOME Initial Setup maintainer(s)
GNOME Initial Setup maintainer(s)
: 698787 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-04-17 19:51 UTC by Baptiste Mille-Mathias
Modified: 2013-07-17 19:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
um-utils: Don't allow duplicates of the same suggestion (1.66 KB, patch)
2013-05-17 18:44 UTC, Michael Wood
accepted-commit_now Details | Review

Description Baptiste Mille-Mathias 2013-04-17 19:51:49 UTC
if during the user creation, I set not the full name, but only the firstname for instance, the login combobox proposes the same login twice.

gnome-initial-setup-0.8-3.fc19.x86_64
Comment 1 Michael Wood 2013-05-14 17:09:34 UTC
*** Bug 698787 has been marked as a duplicate of this bug. ***
Comment 2 Michael Wood 2013-05-17 18:44:07 UTC
Created attachment 244570 [details] [review]
um-utils: Don't allow duplicates of the same suggestion

This is because these insert the same string when there is a single string. (nwords2 is always > 0 in this case)

um-utils.c:298
         in_use = is_username_used (item0->str);
         if (!in_use && !g_ascii_isdigit (item0->str[0])) {
                 gtk_list_store_append (store, &iter);
                 gtk_list_store_set (store, &iter, 0, item0->str, -1);
                 g_hash_table_insert (items, item0->str, item0->str);
 
         in_use = is_username_used (item1->str);
         if (nwords2 > 0 && !in_use && !g_ascii_isdigit (item1->str[0])) {
                 gtk_list_store_append (store, &iter);
                 gtk_list_store_set (store, &iter, 0, item1->str, -1);
                 g_hash_table_insert (items, item1->str, item1->str);

I've had a look and due to the way it's written it would be difficult to keep the correct behaviour by making sure the check is nwords2 > 1 as the code path for handling second words and special characters is entangled.
Comment 3 Matthias Clasen 2013-05-18 22:32:26 UTC
We need the same change in the control-center copy of this code, then.
Comment 4 Matthias Clasen 2013-05-19 14:38:15 UTC
Review of attachment 244570 [details] [review]:

Works in brief testing, so lets go with it. Don't forget to push the same change to the control-center.
Comment 5 Michael Wood 2013-05-20 09:19:46 UTC
Pushed:

gnome-control-center - 654f4bb2ec468db6d4052266f9d27961b3980be7
gnome-initial-setup - bb073d15d191dbaa6570d2e9d8770b82504700d8
Comment 6 Jonh Wendell 2013-07-17 19:51:49 UTC
would you mind to backport (cherry-pick) to gnome-3-8 branch as well?