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 778686 - Network connections are not sorted after a connection is renamed
Network connections are not sorted after a connection is renamed
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: network-indicator
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-02-15 15:24 UTC by Benjamin Berg
Modified: 2017-02-15 21:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ui: Allow moving menu items to a certain position (1.44 KB, patch)
2017-02-15 15:25 UTC, Benjamin Berg
accepted-commit_now Details | Review
network: Ensure the connection list is sorted after rename (1.71 KB, patch)
2017-02-15 15:25 UTC, Benjamin Berg
accepted-commit_now Details | Review

Description Benjamin Berg 2017-02-15 15:24:02 UTC
The list of networks (in particular VPNs) is sorted by doing an insertion sort when the network is added initially. However in some cases network can be renamed (e.g. when they are being added programatically by a script) and then the user ends up with an unordered list until they restart the shell.

I am attaching a patchset to solve this issue by updating the sorting position whenever a connection is modified.
Comment 1 Benjamin Berg 2017-02-15 15:25:35 UTC
Created attachment 345840 [details] [review]
ui: Allow moving menu items to a certain position

This function is a helper to simplify keeping menu items ordered when
their order is updated on the fly (e.g. network connections being
renamed).

https://bugzilla.redhat.com/show_bug.cgi?id=1404663
Comment 2 Benjamin Berg 2017-02-15 15:25:41 UTC
Created attachment 345841 [details] [review]
network: Ensure the connection list is sorted after rename

Items were inserted correctly but the synchronisation was lost if the
name of a connection was changed. Simply making sure the position is
correct after a connection is updated fixes the issue.

Reported-by: Oliver Haessler <ohaessle@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1404663
Comment 3 Florian Müllner 2017-02-15 16:46:15 UTC
Review of attachment 345840 [details] [review]:

OK
Comment 4 Florian Müllner 2017-02-15 16:46:24 UTC
Review of attachment 345841 [details] [review]:

LGTM
Comment 5 Benjamin Berg 2017-02-15 21:50:23 UTC
Thanks for the review, pushed.