[PATCH 3/3] Avoid segfaulting on legacy accounts, where the XDG



Using TrackerItemFactory::get_safe_user_special_dir() to provide for
fallbacks now.

Signed-off-by: Cyrille Chepelov <cyrille chepelov keyconsulting fr>
---
 .../tracker/rygel-tracker-music-item-factory.vala  |    4 +++-
 .../rygel-tracker-picture-item-factory.vala        |    2 +-
 .../tracker/rygel-tracker-video-item-factory.vala  |    2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/plugins/tracker/rygel-tracker-music-item-factory.vala b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
index b630fd7..30206ed 100644
--- a/src/plugins/tracker/rygel-tracker-music-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-music-item-factory.vala
@@ -38,11 +38,13 @@ public class Rygel.TrackerMusicItemFactory : Rygel.TrackerItemFactory {
 
     private const string CATEGORY = "nmm:MusicPiece";
 
+
+
     public TrackerMusicItemFactory () {
         base (CATEGORY,
               MediaItem.MUSIC_CLASS,
               MUSIC_RESOURCES_CLASS_PATH,
-              Environment.get_user_special_dir (UserDirectory.MUSIC));
+	      get_safe_user_special_dir(UserDirectory.MUSIC));
 
         for (var i = this.key_chains.size; i < MusicMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());
diff --git a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
index 8ca0b94..3b8a9f2 100644
--- a/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-picture-item-factory.vala
@@ -40,7 +40,7 @@ public class Rygel.TrackerPictureItemFactory : Rygel.TrackerItemFactory {
         base (CATEGORY,
               MediaItem.IMAGE_CLASS,
               PHOTO_RESOURCES_CLASS_PATH,
-              Environment.get_user_special_dir (UserDirectory.PICTURES));
+              get_safe_user_special_dir (UserDirectory.PICTURES));
 
         for (var i = this.key_chains.size; i < PictureMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());
diff --git a/src/plugins/tracker/rygel-tracker-video-item-factory.vala b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
index cd115b7..68b5cd3 100644
--- a/src/plugins/tracker/rygel-tracker-video-item-factory.vala
+++ b/src/plugins/tracker/rygel-tracker-video-item-factory.vala
@@ -41,7 +41,7 @@ public class Rygel.TrackerVideoItemFactory : Rygel.TrackerItemFactory {
         base (CATEGORY,
               MediaItem.VIDEO_CLASS,
               VIDEO_RESOURCES_CLASS_PATH,
-              Environment.get_user_special_dir (UserDirectory.VIDEOS));
+              get_safe_user_special_dir(UserDirectory.VIDEOS));
 
         for (var i = this.key_chains.size; i < VideoMetadata.LAST_KEY; i++) {
             this.key_chains.add (new ArrayList<string> ());
-- 
1.6.6.1


--=-JyxFSry9bNuTYyGYB888--



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