tracker: ItemFactory provides 'upload_dir'
authorZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Thu, 4 Feb 2010 16:01:29 +0000 (18:01 +0200)
committerZeeshan Ali (Khattak) <zeeshanak@gnome.org>
Fri, 12 Feb 2010 15:53:25 +0000 (17:53 +0200)
ItemFactory implementations should provide upload directory path.

src/plugins/tracker/rygel-tracker-item-factory.vala
src/plugins/tracker/rygel-tracker-music-item-factory.vala
src/plugins/tracker/rygel-tracker-picture-item-factory.vala
src/plugins/tracker/rygel-tracker-video-item-factory.vala

index 3f27f7a..1a7537c 100644 (file)
@@ -40,15 +40,18 @@ public abstract class Rygel.TrackerItemFactory {
     public string category;
     public string upnp_class;
     public string resources_class_path;
+    public string upload_dir;
 
     public ArrayList<ArrayList<string>> key_chains;
 
     public TrackerItemFactory (string category,
                                string upnp_class,
-                               string resources_class_path) {
+                               string resources_class_path,
+                               string upload_dir) {
         this.category = category;
         this.upnp_class = upnp_class;
         this.resources_class_path = resources_class_path;
+        this.upload_dir = upload_dir;
 
         this.key_chains = new ArrayList<ArrayList<string>> ();
 
index a10d2e3..7de4e93 100644 (file)
@@ -39,7 +39,10 @@ public class Rygel.TrackerMusicItemFactory : Rygel.TrackerItemFactory {
     private const string CATEGORY = "nmm:MusicPiece";
 
     public TrackerMusicItemFactory () {
-        base (CATEGORY, MediaItem.MUSIC_CLASS, MUSIC_RESOURCES_CLASS_PATH);
+        base (CATEGORY,
+              MediaItem.MUSIC_CLASS,
+              MUSIC_RESOURCES_CLASS_PATH,
+              Environment.get_user_special_dir (UserDirectory.MUSIC));
 
         for (var i = this.key_chains.size; i < MusicMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());
index d5abebe..8ca0b94 100644 (file)
@@ -37,7 +37,10 @@ public class Rygel.TrackerPictureItemFactory : Rygel.TrackerItemFactory {
     private const string CATEGORY = "nmm:Photo";
 
     public TrackerPictureItemFactory () {
-        base (CATEGORY, MediaItem.IMAGE_CLASS, PHOTO_RESOURCES_CLASS_PATH);
+        base (CATEGORY,
+              MediaItem.IMAGE_CLASS,
+              PHOTO_RESOURCES_CLASS_PATH,
+              Environment.get_user_special_dir (UserDirectory.PICTURES));
 
         for (var i = this.key_chains.size; i < PictureMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());
index cb1accf..0c15907 100644 (file)
@@ -38,7 +38,10 @@ public class Rygel.TrackerVideoItemFactory : Rygel.TrackerItemFactory {
     private const string CATEGORY = "nmm:Video";
 
     public TrackerVideoItemFactory () {
-        base (CATEGORY, MediaItem.VIDEO_CLASS, VIDEO_RESOURCES_CLASS_PATH);
+        base (CATEGORY,
+              MediaItem.VIDEO_CLASS,
+              VIDEO_RESOURCES_CLASS_PATH,
+              Environment.get_user_special_dir (UserDirectory.VIDEOS));
 
         for (var i = this.key_chains.size; i < VideoMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());