[gnome-contacts] Don't use anonymous lambdas if not necessary.



commit 608e366266ce62a548399f883256dd6fdf0ed514
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Mon Jan 22 21:38:27 2018 +0100

    Don't use anonymous lambdas if not necessary.
    
    This is effectively a function call less, *and* it's easier to debug in
    a stracktrace if necessary.

 src/contacts-contact-list.vala |    4 ++--
 src/contacts-list-pane.vala    |    4 ++--
 src/contacts-window.vala       |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/contacts-contact-list.vala b/src/contacts-contact-list.vala
index 618ecc8..a4ee808 100644
--- a/src/contacts-contact-list.vala
+++ b/src/contacts-contact-list.vala
@@ -111,7 +111,7 @@ public class Contacts.ContactList : ListBox {
     this.filter_query.notify.connect (() => { invalidate_filter (); });
     this.visible = true;
 
-    this.notify["state"].connect ( () => { on_ui_state_changed(); });
+    this.notify["state"].connect (on_ui_state_changed);
 
     this.store.added.connect (contact_added_cb);
     this.store.removed.connect (contact_removed_cb);
@@ -126,7 +126,7 @@ public class Contacts.ContactList : ListBox {
     set_header_func (update_header);
   }
 
-  private void on_ui_state_changed () {
+  private void on_ui_state_changed (Object obj, ParamSpec pspec) {
     foreach (var widget in get_children ()) {
       var row = widget as ContactDataRow;
       row.expose_checkbox (this.state == UiState.SELECTING);
diff --git a/src/contacts-list-pane.vala b/src/contacts-list-pane.vala
index 710cdd0..2c60e15 100644
--- a/src/contacts-list-pane.vala
+++ b/src/contacts-list-pane.vala
@@ -50,7 +50,7 @@ public class Contacts.ListPane : Frame {
 
   public ListPane (Store contacts_store) {
     this.store = contacts_store;
-    this.notify["state"].connect ( () => { on_ui_state_changed(); });
+    this.notify["state"].connect (on_ui_state_changed);
 
     // Build the filter query
     string[] filtered_fields = Query.MATCH_FIELDS_NAMES;
@@ -75,7 +75,7 @@ public class Contacts.ListPane : Frame {
       });
   }
 
-  private void on_ui_state_changed () {
+  private void on_ui_state_changed (Object obj, ParamSpec pspec) {
     // Disable when editing a contact. (Not using `this.sensitive` to allow scrolling)
     this.filter_entry.sensitive
         = this.contacts_list.sensitive
diff --git a/src/contacts-window.vala b/src/contacts-window.vala
index a2f027f..1b25885 100644
--- a/src/contacts-window.vala
+++ b/src/contacts-window.vala
@@ -66,7 +66,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
       store: contacts_store
     );
 
-    this.notify["state"].connect ( () => { on_ui_state_changed(); });
+    this.notify["state"].connect (on_ui_state_changed);
 
     create_contact_pane ();
     set_headerbar_layout ();
@@ -114,7 +114,7 @@ public class Contacts.Window : Gtk.ApplicationWindow {
     list_pane.show ();
   }
 
-  private void on_ui_state_changed () {
+  private void on_ui_state_changed (Object obj, ParamSpec pspec) {
     // UI when we're not editing of selecting stuff
     this.add_button.visible
         = this.right_header.show_close_button


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