[gnome-clocks] Use our own delegate type



commit 503e19e1c5c98cd6530eb95aa5f3bf82ab4316b6
Author: Paolo Borelli <pborelli gnome org>
Date:   Mon Feb 25 23:02:56 2013 +0100

    Use our own delegate type
    
    Hide the libnotify implemetation details to the callers.

 src/utils.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/utils.vala b/src/utils.vala
index 6005a84..a55e730 100644
--- a/src/utils.vala
+++ b/src/utils.vala
@@ -282,6 +282,8 @@ public class Bell : Object {
     private string sound;
     private Notify.Notification? notification;
 
+    public delegate void ActionCallback ();
+
     public Bell (string soundid, string title, string msg) {
         settings = new GLib.Settings("org.gnome.desktop.sound");
 
@@ -353,9 +355,11 @@ public class Bell : Object {
         }
     }
 
-    public void add_action (string action, string label, owned Notify.ActionCallback callback) {
+    public void add_action (string action, string label, owned ActionCallback callback) {
         if (notification != null) {
-            notification.add_action (action, label, (owned) callback);
+            notification.add_action (action, label, (n, a) => {
+                callback ();
+            });
         }
     }
 }


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