rygel r603 - trunk/src/plugins/tracker



Author: zeeshanak
Date: Sun Feb 15 21:58:00 2009
New Revision: 603
URL: http://svn.gnome.org/viewvc/rygel?rev=603&view=rev

Log:
Rename (category) container to category.

Added:
   trunk/src/plugins/tracker/rygel-tracker-category.vala
      - copied, changed from r602, /trunk/src/plugins/tracker/rygel-tracker-container.vala
   trunk/src/plugins/tracker/rygel-tracker-image-category.vala
      - copied, changed from r602, /trunk/src/plugins/tracker/rygel-tracker-image-container.vala
   trunk/src/plugins/tracker/rygel-tracker-music-category.vala
      - copied, changed from r602, /trunk/src/plugins/tracker/rygel-tracker-music-container.vala
   trunk/src/plugins/tracker/rygel-tracker-video-category.vala
      - copied, changed from r602, /trunk/src/plugins/tracker/rygel-tracker-video-container.vala
Removed:
   trunk/src/plugins/tracker/rygel-tracker-container.vala
   trunk/src/plugins/tracker/rygel-tracker-image-container.vala
   trunk/src/plugins/tracker/rygel-tracker-music-container.vala
   trunk/src/plugins/tracker/rygel-tracker-video-container.vala
Modified:
   trunk/src/plugins/tracker/Makefile.am
   trunk/src/plugins/tracker/rygel-tracker-get-metadata-result.vala
   trunk/src/plugins/tracker/rygel-tracker-image-item.vala
   trunk/src/plugins/tracker/rygel-tracker-item.vala
   trunk/src/plugins/tracker/rygel-tracker-music-item.vala
   trunk/src/plugins/tracker/rygel-tracker-root-container.vala
   trunk/src/plugins/tracker/rygel-tracker-search-result.vala
   trunk/src/plugins/tracker/rygel-tracker-video-item.vala

Modified: trunk/src/plugins/tracker/Makefile.am
==============================================================================
--- trunk/src/plugins/tracker/Makefile.am	(original)
+++ trunk/src/plugins/tracker/Makefile.am	Sun Feb 15 21:58:00 2009
@@ -14,14 +14,14 @@
 		rygel-media-tracker.c \
 		rygel-tracker-root-container.h \
 		rygel-tracker-root-container.c \
-		rygel-tracker-container.h \
-		rygel-tracker-container.c \
-		rygel-tracker-video-container.h \
-		rygel-tracker-video-container.c \
-		rygel-tracker-music-container.h \
-		rygel-tracker-music-container.c \
-		rygel-tracker-image-container.h \
-		rygel-tracker-image-container.c \
+		rygel-tracker-category.h \
+		rygel-tracker-category.c \
+		rygel-tracker-video-category.h \
+		rygel-tracker-video-category.c \
+		rygel-tracker-music-category.h \
+		rygel-tracker-music-category.c \
+		rygel-tracker-image-category.h \
+		rygel-tracker-image-category.c \
 		rygel-tracker-search-result.h \
 		rygel-tracker-search-result.c \
 		rygel-tracker-get-metadata-result.h \
@@ -43,18 +43,18 @@
 				    rygel-tracker-root-container.h \
 				    rygel-tracker-root-container.c \
 				    rygel-tracker-root-container.vala \
-				    rygel-tracker-container.h \
-			            rygel-tracker-container.c \
-				    rygel-tracker-container.vala \
-				    rygel-tracker-video-container.h \
-				    rygel-tracker-video-container.c \
-				    rygel-tracker-video-container.vala \
-				    rygel-tracker-music-container.h \
-				    rygel-tracker-music-container.c \
-				    rygel-tracker-music-container.vala \
-				    rygel-tracker-image-container.h \
-				    rygel-tracker-image-container.c \
-				    rygel-tracker-image-container.vala \
+				    rygel-tracker-category.h \
+			            rygel-tracker-category.c \
+				    rygel-tracker-category.vala \
+				    rygel-tracker-video-category.h \
+				    rygel-tracker-video-category.c \
+				    rygel-tracker-video-category.vala \
+				    rygel-tracker-music-category.h \
+				    rygel-tracker-music-category.c \
+				    rygel-tracker-music-category.vala \
+				    rygel-tracker-image-category.h \
+				    rygel-tracker-image-category.c \
+				    rygel-tracker-image-category.vala \
 				    rygel-tracker-search-result.h \
 				    rygel-tracker-search-result.c \
 				    rygel-tracker-search-result.vala \

Copied: trunk/src/plugins/tracker/rygel-tracker-category.vala (from r602, /trunk/src/plugins/tracker/rygel-tracker-container.vala)
==============================================================================
--- /trunk/src/plugins/tracker/rygel-tracker-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-category.vala	Sun Feb 15 21:58:00 2009
@@ -29,7 +29,7 @@
 /**
  * Represents Tracker category.
  */
-public abstract class Rygel.TrackerContainer : MediaContainer {
+public abstract class Rygel.TrackerCategory : MediaContainer {
     /* class-wide constants */
     private const string TRACKER_SERVICE = "org.freedesktop.Tracker";
     private const string TRACKER_PATH = "/org/freedesktop/Tracker";
@@ -50,11 +50,11 @@
 
     Gee.List<AsyncResult> results;
 
-    public TrackerContainer (string id,
-                             string parent_id,
-                             string title,
-                             string category,
-                             string child_class) {
+    public TrackerCategory (string id,
+                            string parent_id,
+                            string title,
+                            string category,
+                            string child_class) {
         base (id, parent_id, title, 0);
 
         this.category = category;
@@ -69,15 +69,15 @@
             return;
         }
 
-        this.metadata = connection.get_object (TrackerContainer.TRACKER_SERVICE,
-                                               TrackerContainer.METADATA_PATH,
-                                               TrackerContainer.METADATA_IFACE);
-        this.search = connection.get_object (TrackerContainer.TRACKER_SERVICE,
-                                             TrackerContainer.SEARCH_PATH,
-                                             TrackerContainer.SEARCH_IFACE);
-        this.tracker = connection.get_object (TrackerContainer.TRACKER_SERVICE,
-                                              TrackerContainer.TRACKER_PATH,
-                                              TrackerContainer.TRACKER_IFACE);
+        this.metadata = connection.get_object (TrackerCategory.TRACKER_SERVICE,
+                                               TrackerCategory.METADATA_PATH,
+                                               TrackerCategory.METADATA_IFACE);
+        this.search = connection.get_object (TrackerCategory.TRACKER_SERVICE,
+                                             TrackerCategory.SEARCH_PATH,
+                                             TrackerCategory.SEARCH_IFACE);
+        this.tracker = connection.get_object (TrackerCategory.TRACKER_SERVICE,
+                                              TrackerCategory.TRACKER_PATH,
+                                              TrackerCategory.TRACKER_IFACE);
 
         /* FIXME: We need to hook to some tracker signals to keep
          *        this field up2date at all times

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	Sun Feb 15 21:58:00 2009
@@ -36,10 +36,10 @@
     public MediaObject data;
     public Error error;
 
-    public TrackerGetMetadataResult (TrackerContainer   container,
+    public TrackerGetMetadataResult (TrackerCategory    category,
                                      AsyncReadyCallback callback,
                                      string             item_id) {
-        this.source_object = container;
+        this.source_object = category;
         this.callback = callback;
         this.item_id = item_id;
     }
@@ -52,10 +52,10 @@
             return;
         }
 
-        TrackerContainer container = (TrackerContainer) this.source_object;
+        TrackerCategory category = (TrackerCategory) this.source_object;
 
-        string path = container.get_item_path (item_id);
-        this.data = container.create_item (path, metadata);
+        string path = category.get_item_path (item_id);
+        this.data = category.create_item (path, metadata);
 
         this.complete ();
     }

Copied: trunk/src/plugins/tracker/rygel-tracker-image-category.vala (from r602, /trunk/src/plugins/tracker/rygel-tracker-image-container.vala)
==============================================================================
--- /trunk/src/plugins/tracker/rygel-tracker-image-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-image-category.vala	Sun Feb 15 21:58:00 2009
@@ -26,10 +26,10 @@
 /**
  * Represents Tracker Image category.
  */
-public class Rygel.TrackerImageContainer : Rygel.TrackerContainer {
-    public TrackerImageContainer (string id,
-                                  string parent_id,
-                                  string title) {
+public class Rygel.TrackerImageCategory : Rygel.TrackerCategory {
+    public TrackerImageCategory (string id,
+                                 string parent_id,
+                                 string title) {
         base (id, parent_id, title, "Images", MediaItem.IMAGE_CLASS);
     }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-image-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-image-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-image-item.vala	Sun Feb 15 21:58:00 2009
@@ -43,10 +43,10 @@
         LAST_KEY
     }
 
-    public TrackerImageItem (string           id,
-                             string           path,
-                             TrackerContainer parent,
-                             string[]         metadata) {
+    public TrackerImageItem (string          id,
+                             string          path,
+                             TrackerCategory parent,
+                             string[]        metadata) {
         base (id, path, parent, metadata);
     }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-item.vala	Sun Feb 15 21:58:00 2009
@@ -31,10 +31,10 @@
 public abstract class Rygel.TrackerItem : MediaItem {
     protected string path;
 
-    public TrackerItem (string           id,
-                        string           path,
-                        TrackerContainer parent,
-                        string[]         metadata) {
+    public TrackerItem (string          id,
+                        string          path,
+                        TrackerCategory parent,
+                        string[]        metadata) {
         base (id, parent.id, "", parent.child_class);
 
         this.path = path;

Copied: trunk/src/plugins/tracker/rygel-tracker-music-category.vala (from r602, /trunk/src/plugins/tracker/rygel-tracker-music-container.vala)
==============================================================================
--- /trunk/src/plugins/tracker/rygel-tracker-music-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-music-category.vala	Sun Feb 15 21:58:00 2009
@@ -26,10 +26,10 @@
 /**
  * Represents Tracker Music category.
  */
-public class Rygel.TrackerMusicContainer : Rygel.TrackerContainer {
-    public TrackerMusicContainer (string id,
-                                  string parent_id,
-                                  string title) {
+public class Rygel.TrackerMusicCategory : Rygel.TrackerCategory {
+    public TrackerMusicCategory (string id,
+                                 string parent_id,
+                                 string title) {
         base (id, parent_id, title, "Music", MediaItem.MUSIC_CLASS);
     }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-music-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-music-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-music-item.vala	Sun Feb 15 21:58:00 2009
@@ -43,10 +43,10 @@
         LAST_KEY
     }
 
-    public TrackerMusicItem (string           id,
-                             string           path,
-                             TrackerContainer parent,
-                             string[]         metadata) {
+    public TrackerMusicItem (string          id,
+                             string          path,
+                             TrackerCategory parent,
+                             string[]        metadata) {
         base (id, path, parent, metadata);
     }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-root-container.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-root-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-root-container.vala	Sun Feb 15 21:58:00 2009
@@ -32,27 +32,27 @@
  */
 public class Rygel.TrackerRootContainer : MediaContainer {
     /* FIXME: Make this a static if you know how to initize it */
-    private ArrayList<TrackerContainer> containers;
+    private ArrayList<TrackerCategory> categories;
 
     public TrackerRootContainer (string title) {
         base.root (title, 0);
 
-        this.containers = new ArrayList<TrackerContainer> ();
-        this.containers.add
-                        (new TrackerImageContainer ("16",
-                                                    this.id,
-                                                    "All Images"));
-        this.containers.add
-                        (new TrackerMusicContainer ("14",
-                                                    this.id,
-                                                    "All Music"));
-        this.containers.add
-                        (new TrackerVideoContainer ("15",
-                                                    this.id,
-                                                    "All Videos"));
+        this.categories = new ArrayList<TrackerCategory> ();
+        this.categories.add
+                        (new TrackerImageCategory ("16",
+                                                   this.id,
+                                                   "All Images"));
+        this.categories.add
+                        (new TrackerMusicCategory ("14",
+                                                   this.id,
+                                                   "All Music"));
+        this.categories.add
+                        (new TrackerVideoCategory ("15",
+                                                   this.id,
+                                                   "All Videos"));
 
         // Now we know how many top-level containers we have
-        this.child_count = this.containers.size;
+        this.child_count = this.categories.size;
     }
 
     public override void get_children (uint               offset,
@@ -62,7 +62,7 @@
         uint stop = offset + max_count;
 
         stop = stop.clamp (0, this.child_count);
-        var children = this.containers.slice ((int) offset, (int) stop);
+        var children = this.categories.slice ((int) offset, (int) stop);
 
         var res = new Rygel.SimpleAsyncResult<Gee.List<MediaObject>> (
                                         this,
@@ -82,14 +82,14 @@
                                       Cancellable?       cancellable,
                                       AsyncReadyCallback callback) {
         /* First try containers */
-        MediaObject media_object = find_container_by_id (id);
+        MediaObject media_object = find_category_by_id (id);
 
         if (media_object == null) {
             /* Now try items */
-            var container = get_item_parent (id);
+            var category = get_item_category (id);
 
-            if (container != null) {
-                container.find_object (id, cancellable, callback);
+            if (category != null) {
+                category.find_object (id, cancellable, callback);
                 return;
             }
         }
@@ -107,32 +107,32 @@
     }
 
     /* Private methods */
-    private TrackerContainer? find_container_by_id (string container_id) {
-        TrackerContainer container;
+    private TrackerCategory? find_category_by_id (string category_id) {
+        TrackerCategory category;
 
-        container = null;
+        category = null;
 
-        foreach (TrackerContainer tmp in this.containers)
-            if (container_id == tmp.id) {
-                container = tmp;
+        foreach (TrackerCategory tmp in this.categories)
+            if (category_id == tmp.id) {
+                category = tmp;
 
                 break;
             }
 
-        return container;
+        return category;
     }
 
-    private TrackerContainer? get_item_parent (string item_id) {
-        TrackerContainer container = null;
-        foreach (TrackerContainer tmp in this.containers) {
+    private TrackerCategory? get_item_category (string item_id) {
+        TrackerCategory category = null;
+        foreach (TrackerCategory tmp in this.categories) {
             if (tmp.is_thy_child (item_id)) {
-                container = tmp;
+                category = tmp;
 
                 break;
             }
         }
 
-        return container;
+        return category;
     }
 }
 

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	Sun Feb 15 21:58:00 2009
@@ -36,9 +36,9 @@
     public Gee.List<MediaObject> data;
     public GLib.Error error;
 
-    public TrackerSearchResult (TrackerContainer   container,
+    public TrackerSearchResult (TrackerCategory    category,
                                 AsyncReadyCallback callback) {
-        this.source_object = container;
+        this.source_object = category;
         this.callback = callback;
 
         this.data = new ArrayList<MediaObject> ();
@@ -52,14 +52,14 @@
             return;
         }
 
-        TrackerContainer container = (TrackerContainer) this.source_object;
+        TrackerCategory category = (TrackerCategory) this.source_object;
 
         /* Iterate through all items */
         for (uint i = 0; i < search_result.length; i++) {
             string child_path = search_result[i][0];
             string[] metadata = this.slice_strv_tail (search_result[i], 2);
 
-            var item = container.create_item (child_path, metadata);
+            var item = category.create_item (child_path, metadata);
             this.data.add (item);
         }
 

Copied: trunk/src/plugins/tracker/rygel-tracker-video-category.vala (from r602, /trunk/src/plugins/tracker/rygel-tracker-video-container.vala)
==============================================================================
--- /trunk/src/plugins/tracker/rygel-tracker-video-container.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-video-category.vala	Sun Feb 15 21:58:00 2009
@@ -26,10 +26,10 @@
 /**
  * Represents Tracker Video category.
  */
-public class Rygel.TrackerVideoContainer : Rygel.TrackerContainer {
-    public TrackerVideoContainer (string id,
-                                  string parent_id,
-                                  string title) {
+public class Rygel.TrackerVideoCategory : Rygel.TrackerCategory {
+    public TrackerVideoCategory (string id,
+                                 string parent_id,
+                                 string title) {
         base (id, parent_id, title, "Videos", MediaItem.VIDEO_CLASS);
     }
 

Modified: trunk/src/plugins/tracker/rygel-tracker-video-item.vala
==============================================================================
--- trunk/src/plugins/tracker/rygel-tracker-video-item.vala	(original)
+++ trunk/src/plugins/tracker/rygel-tracker-video-item.vala	Sun Feb 15 21:58:00 2009
@@ -41,10 +41,10 @@
         LAST_KEY
     }
 
-    public TrackerVideoItem (string           id,
-                             string           path,
-                             TrackerContainer parent,
-                             string[]         metadata) {
+    public TrackerVideoItem (string          id,
+                             string          path,
+                             TrackerCategory parent,
+                             string[]        metadata) {
         base (id, path, parent, metadata);
     }
 



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