[gnome-boxes] list-view-row: Make use of property bindings



commit 7fecdb6551dae12524a394251c84d5450bf0047e
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Aug 25 14:24:53 2015 +0100

    list-view-row: Make use of property bindings

 src/list-view-row.vala |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/list-view-row.vala b/src/list-view-row.vala
index 34432d9..5ad5987 100644
--- a/src/list-view-row.vala
+++ b/src/list-view-row.vala
@@ -74,15 +74,15 @@ private class Boxes.ListViewRow: Gtk.Box {
 
         machine.config.notify["categories"].connect (update_favorite);
         machine.notify["under-construction"].connect (update_thumbnail);
-        machine.notify["name"].connect (update_name);
         machine.notify["info"].connect (update_info);
         machine.notify["state"].connect (update_state);
 
         update_thumbnail ();
-        update_name ();
         update_favorite ();
         update_info ();
         update_state ();
+
+        machine.bind_property ("name", machine_name, "label", BindingFlags.SYNC_CREATE);
     }
 
     private void update_thumbnail () {
@@ -104,10 +104,6 @@ private class Boxes.ListViewRow: Gtk.Box {
             favorite.clear ();
     }
 
-    private void update_name () {
-        machine_name.label = machine.name;
-    }
-
     private void update_info () {
         info_label.label = machine.info;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]