[grilo-plugins] [filesystem] Set NULL id for root category



commit f288fd9dffe07c158b3d36fde1cb0b28d374a033
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri May 21 13:01:50 2010 +0200

    [filesystem] Set NULL id for root category
    
    In Grilo, identifiers for root category should be always NULL, as clients could
    rely on this to do their job.
    
    So instead of using '/' as the identifier for root category, use NULL.

 src/filesystem/grl-filesystem.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index fafeb2e..ab13ee4 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -354,8 +354,10 @@ create_content (GrlMedia *content,
     g_object_unref (info);
   }
 
-  /* ID */
-  grl_media_set_id (media, path);
+  /* ID: if root path, then id must be kept NULL */
+  grl_media_set_id (media,
+                    g_strcmp0 (path,
+                               G_DIR_SEPARATOR_S) == 0? NULL: path);
 
   /* URL */
   str = g_strconcat ("file://", path, NULL);



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