rygel r594 - trunk/src/plugins/tracker



Author: zeeshanak
Date: Sat Feb 14 15:32:44 2009
New Revision: 594
URL: http://svn.gnome.org/viewvc/rygel?rev=594&view=rev

Log:
Put TrackerGetMetadataResult in separate file.

Added:
   trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala
Modified:
   trunk/src/plugins/tracker/Makefile.am
   trunk/src/plugins/tracker/rygel-tracker-container.vala

Modified: trunk/src/plugins/tracker/Makefile.am
==============================================================================
--- trunk/src/plugins/tracker/Makefile.am	(original)
+++ trunk/src/plugins/tracker/Makefile.am	Sat Feb 14 15:32:44 2009
@@ -24,6 +24,8 @@
 		rygel-tracker-image-container.c \
 		rygel-tracker-search-result.h \
 		rygel-tracker-search-result.c \
+		rygel-tracker-get-metadata-result.h \
+		rygel-tracker-get-metadata-result.c \
 		rygel-tracker-item.h \
 		rygel-tracker-item.c \
 		rygel-tracker-video-item.h \
@@ -56,6 +58,9 @@
 				    rygel-tracker-search-result.h \
 				    rygel-tracker-search-result.c \
 				    rygel-tracker-search-result.vala \
+				    rygel-tracker-get-metadata-result.h \
+				    rygel-tracker-get-metadata-result.c \
+				    rygel-tracker-get-metadata-result.vala \
                                     rygel-tracker-item.h \
                                     rygel-tracker-item.c \
                                     rygel-tracker-item.vala \

Modified: trunk/src/plugins/tracker/rygel-tracker-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-container.vala	Sat Feb 14 15:32:44 2009
@@ -219,62 +219,3 @@
     protected abstract MediaItem? create_item (string path, string[] metadata);
 }
 
-/**
- * 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 GLib.Object source_object;
-    protected AsyncReadyCallback callback;
-    protected string item_id;
-
-    public MediaObject data;
-    public GLib.Error error;
-
-    public TrackerGetMetadataResult (TrackerContainer   container,
-                                     AsyncReadyCallback callback,
-                                     string             item_id) {
-        this.source_object = container;
-        this.callback = callback;
-        this.item_id = item_id;
-    }
-
-    public void ready (string[] metadata, GLib.Error error) {
-        if (error != null) {
-            this.error = error;
-
-            this.complete ();
-        }
-
-        TrackerContainer container = (TrackerContainer) this.source_object;
-
-        string path = container.get_item_path (item_id);
-        this.data = container.create_item (path, metadata);
-
-        this.complete ();
-    }
-
-    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;
-    }
-}

Added: trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala
==============================================================================
--- (empty file)
+++ trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala	Sat Feb 14 15:32:44 2009
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2009 Nokia Corporation, all rights reserved.
+ *
+ * Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
+ *
+ * This file is part of Rygel.
+ *
+ * Rygel is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Rygel is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+using Rygel;
+
+/**
+ * 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;
+    protected string item_id;
+
+    public MediaObject data;
+    public Error error;
+
+    public TrackerGetMetadataResult (TrackerContainer   container,
+                                     AsyncReadyCallback callback,
+                                     string             item_id) {
+        this.source_object = container;
+        this.callback = callback;
+        this.item_id = item_id;
+    }
+
+    public void ready (string[] metadata, Error error) {
+        if (error != null) {
+            this.error = error;
+
+            this.complete ();
+        }
+
+        TrackerContainer container = (TrackerContainer) this.source_object;
+
+        string path = container.get_item_path (item_id);
+        this.data = container.create_item (path, metadata);
+
+        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;
+    }
+}



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