[gnome-boxes/wip/props-ui-files: 95/96] properties: Drop redundant refs of pages
- From: Zeeshan Ali <zeeshanak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-boxes/wip/props-ui-files: 95/96] properties: Drop redundant refs of pages
- Date: Sat, 26 Nov 2016 16:44:49 +0000 (UTC)
commit 8f98c0cf7ba5506856f267937a0a39dad0da5feb
Author: Zeeshan Ali <zeenix gmail com>
Date: Sat Nov 26 17:02:44 2016 +0100
properties: Drop redundant refs of pages
And simplify the code as result.
src/properties.vala | 14 ++++++--------
1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/src/properties.vala b/src/properties.vala
index 0e71aa0..edfe5e8 100644
--- a/src/properties.vala
+++ b/src/properties.vala
@@ -39,7 +39,6 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
var label = new Gtk.Label (page.name);
insert_page (page, label, i);
- set_data<PropertiesPageWidget> (@"boxes-property-$i", page);
page.show_all ();
ulong props_refresh_id = 0;
@@ -77,14 +76,13 @@ private class Boxes.Properties: Gtk.Notebook, Boxes.UI {
} else if (previous_ui_state == UIState.PROPERTIES) {
var reboot_required = false;
- for (var i = 0; i < PropertiesPage.LAST; i++) {
- var page = get_data<PropertiesPageWidget> (@"boxes-property-$i");
- if (page != null)
- reboot_required |= page.flush_changes ();
- }
+ foreach (var child in get_children ()) {
+ var page = child as PropertiesPageWidget;
+
+ reboot_required |= page.flush_changes ();
- foreach (var page in get_children ())
- remove (page);
+ remove (child);
+ }
var machine = window.current_item as Machine;
if (reboot_required && (machine.is_on || machine.state == Machine.MachineState.SAVED)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]