mirror of
https://gitlab.gnome.org/julianschacher/top-bar-organizer.git
synced 2025-10-27 15:19:09 +00:00
Refactor: Simplify box order save code in PrefsBOLEmptyPlaceholder
Do this by simply using the `saveBoxOrderToSettings` method of `PrefsBoxOrderListBox`.
This commit is contained in:
parent
f7309e7f65
commit
398793d1a0
@ -26,18 +26,7 @@ var PrefsBoxOrderListEmptyPlaceholder = GObject.registerClass({
|
||||
ownListBox.insert(value, 0);
|
||||
|
||||
/// Finally save the box orders to settings.
|
||||
settings.set_strv(ownListBox.boxOrder, [value.item]);
|
||||
|
||||
let updatedBoxOrder = [ ];
|
||||
for (let potentialListBoxRow of valueListBox) {
|
||||
// Only process PrefsBoxOrderItemRows.
|
||||
if (potentialListBoxRow.constructor.$gtype.name !== "PrefsBoxOrderItemRow") {
|
||||
continue;
|
||||
}
|
||||
|
||||
const item = potentialListBoxRow.item;
|
||||
updatedBoxOrder.push(item);
|
||||
}
|
||||
settings.set_strv(valueListBox.boxOrder, updatedBoxOrder);
|
||||
ownListBox.saveBoxOrderToSettings();
|
||||
valueListBox.saveBoxOrderToSettings();
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user