rygel r619 - trunk/src/plugins/tracker



Author: zeeshanak
Date: Thu Feb 19 17:17:16 2009
New Revision: 619
URL: http://svn.gnome.org/viewvc/rygel?rev=619&view=rev

Log:
All results inherit from Rygel.SimpleAsyncResult.

Modified:
   trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala
   trunk/src/plugins/tracker/rygel-tracker-search-result.vala

Modified: trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala	Thu Feb 19 17:17:16 2009
@@ -25,22 +25,15 @@
 /**
  * Handles Tracker Metadata.Get method results.
  *
- * FIXME: This should inherit from Rygel.SimpleAsyncResult once bug#567319 is
- *        fixed.
  */
-public class Rygel.TrackerGetMetadataResult : GLib.Object, GLib.AsyncResult {
-    protected Object source_object;
-    protected AsyncReadyCallback callback;
+public class Rygel.TrackerGetMetadataResult :
+             Rygel.SimpleAsyncResult<MediaObject> {
     protected string item_id;
 
-    public MediaObject data;
-    public Error error;
-
     public TrackerGetMetadataResult (TrackerCategory    category,
                                      AsyncReadyCallback callback,
                                      string             item_id) {
-        this.source_object = category;
-        this.callback = callback;
+        base (category, callback);
         this.item_id = item_id;
     }
 
@@ -59,26 +52,4 @@
 
         this.complete ();
     }
-
-    public unowned 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;
-    }
 }

Modified: trunk/src/plugins/tracker/rygel-tracker-search-result.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-search-result.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-search-result.vala	Thu Feb 19 17:17:16 2009
@@ -26,20 +26,12 @@
 /**
  * Handles Tracker Search.Query method results.
  *
- * FIXME: This should inherit from Rygel.SimpleAsyncResult once bug#567319 is
- *        fixed.
  */
-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 class Rygel.TrackerSearchResult :
+             Rygel.SimpleAsyncResult<Gee.List<MediaObject>> {
     public TrackerSearchResult (TrackerCategory    category,
                                 AsyncReadyCallback callback) {
-        this.source_object = category;
-        this.callback = callback;
+        base (category, callback);
 
         this.data = new ArrayList<MediaObject> ();
     }
@@ -99,27 +91,5 @@
 
         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;
-    }
 }
 



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