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.gnome.org/show_bug.cgi?id=778686
This commit is contained in:
parent
c75785efff
commit
30e17036e8
@ -299,11 +299,22 @@ const NMConnectionSection = new Lang.Class({
|
|||||||
|
|
||||||
let item = this._connectionItems.get(connection.get_uuid());
|
let item = this._connectionItems.get(connection.get_uuid());
|
||||||
if (item)
|
if (item)
|
||||||
item.updateForConnection(connection);
|
this._updateForConnection(item, connection);
|
||||||
else
|
else
|
||||||
this._addConnection(connection);
|
this._addConnection(connection);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_updateForConnection: function(item, connection) {
|
||||||
|
let pos = this._connections.indexOf(connection);
|
||||||
|
|
||||||
|
this._connections.splice(pos, 1);
|
||||||
|
pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction));
|
||||||
|
this._labelSection.moveMenuItem(item.labelItem, pos);
|
||||||
|
this._radioSection.moveMenuItem(item.radioItem, pos);
|
||||||
|
|
||||||
|
item.updateForConnection(connection);
|
||||||
|
},
|
||||||
|
|
||||||
_addConnection: function(connection) {
|
_addConnection: function(connection) {
|
||||||
let item = this._makeConnectionItem(connection);
|
let item = this._makeConnectionItem(connection);
|
||||||
if (!item)
|
if (!item)
|
||||||
|
Loading…
Reference in New Issue
Block a user