TrackerSearchResult doesn't inherit from SimpleAsyncResult.
authorZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sat, 14 Feb 2009 15:29:59 +0000 (15:29 +0000)
committerZeeshan Ali (Khattak) <zeeshanak@src.gnome.org>
Sat, 14 Feb 2009 15:29:59 +0000 (15:29 +0000)
This is a temporary hack (hopefully) till bug#567319 is fixed.

svn path=/trunk/; revision=585

src/plugins/tracker/rygel-tracker-container.vala

index 78b3d61..0bb48bd 100644 (file)
@@ -221,12 +221,17 @@ public abstract class Rygel.TrackerContainer : MediaContainer {
                                                       string[] metadata);
 }
 
-public class Rygel.TrackerSearchResult :
-             Rygel.SimpleAsyncResult<Gee.List<MediaObject>> {
+public class Rygel.TrackerSearchResult : GLib.Object, GLib.AsyncResult {
+    protected GLib.Object source_object;
+    protected AsyncReadyCallback callback;
+
+    public Gee.List<MediaObject> data;
+    public GLib.Error error;
 
     public TrackerSearchResult (TrackerContainer   container,
-                         AsyncReadyCallback callback) {
-        base (container, callback);
+                                AsyncReadyCallback callback) {
+        this.source_object = container;
+        this.callback = callback;
 
         this.data = new ArrayList<MediaObject> ();
     }
@@ -286,4 +291,26 @@ public class Rygel.TrackerSearchResult :
 
         return i + 1;
     }
+
+    public unowned GLib.Object get_source_object () {
+        return this.source_object;
+    }
+
+    public void* get_user_data () {
+        return null;
+    }
+
+    public void complete () {
+        this.callback (this.source_object, this);
+    }
+
+    public void complete_in_idle () {
+        Idle.add_full (Priority.DEFAULT, idle_func);
+    }
+
+    private bool idle_func () {
+        this.complete ();
+
+        return false;
+    }
 }