[grilo-plugins/tracker-notification] tracker: add support for document files



commit 365f31c0c9a9ccc8050b67b70eb81eec6635f907
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date:   Fri Mar 4 18:13:04 2011 +0000

    tracker: add support for document files
    
    Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>

 src/media/tracker/grl-tracker-api.c   |   13 +++++++++++--
 src/media/tracker/grl-tracker-utils.c |    2 ++
 src/media/tracker/grl-tracker-utils.h |   17 +++++++++--------
 3 files changed, 22 insertions(+), 10 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-api.c b/src/media/tracker/grl-tracker-api.c
index 6a4f9d7..a3f50cc 100644
--- a/src/media/tracker/grl-tracker-api.c
+++ b/src/media/tracker/grl-tracker-api.c
@@ -99,6 +99,7 @@ GRL_LOG_DOMAIN_STATIC(tracker_result_log_domain);
   "{ "                                                  \
   "{ ?urn a nfo:Folder } UNION "                        \
   "{ ?urn a nfo:Audio } UNION "                         \
+  "{ ?urn a nfo:Document } UNION "                      \
   "{ ?urn a nmm:Photo } UNION "                         \
   "{ ?urn a nmm:Video } . "                             \
   "%s "                                                 \
@@ -114,6 +115,7 @@ GRL_LOG_DOMAIN_STATIC(tracker_result_log_domain);
   "{ "                                                          \
   "{ ?urn a nfo:Folder } UNION "                                \
   "{ ?urn a nfo:Audio } UNION "                                 \
+  "{ ?urn a nfo:Document } UNION "                              \
   "{ ?urn a nmm:Photo } UNION "                                 \
   "{ ?urn a nmm:Video } . "                                     \
   "%s "                                                         \
@@ -671,6 +673,13 @@ grl_tracker_source_browse_category (GrlMediaSource *source,
                               grl_metadata_key_tracker_category)) {
     /* Hardcoded categories */
     media = grl_media_box_new ();
+    grl_media_set_title (media, "Documents");
+    grl_data_set_string (GRL_DATA (media),
+                         grl_metadata_key_tracker_category,
+                         "nfo:Document");
+    bs->callback (bs->source, bs->browse_id, media, 3, bs->user_data, NULL);
+
+    media = grl_media_box_new ();
     grl_media_set_title (media, "Music");
     grl_data_set_string (GRL_DATA (media),
                          grl_metadata_key_tracker_category,
@@ -678,14 +687,14 @@ grl_tracker_source_browse_category (GrlMediaSource *source,
     bs->callback (bs->source, bs->browse_id, media, 2, bs->user_data, NULL);
 
     media = grl_media_box_new ();
-    grl_media_set_title (media, "Photo");
+    grl_media_set_title (media, "Photos");
     grl_data_set_string (GRL_DATA (media),
                          grl_metadata_key_tracker_category,
                          "nmm:Photo");
     bs->callback (bs->source, bs->browse_id, media, 1, bs->user_data, NULL);
 
     media = grl_media_box_new ();
-    grl_media_set_title (media, "Video");
+    grl_media_set_title (media, "Videos");
     grl_data_set_string (GRL_DATA (media),
                          grl_metadata_key_tracker_category,
                          "nmm:Video");
diff --git a/src/media/tracker/grl-tracker-utils.c b/src/media/tracker/grl-tracker-utils.c
index 7f07583..ef06b5b 100644
--- a/src/media/tracker/grl-tracker-utils.c
+++ b/src/media/tracker/grl-tracker-utils.c
@@ -235,6 +235,8 @@ grl_tracker_build_grilo_media (const gchar *rdf_type)
       media = grl_media_box_new ();
     } else if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_FOLDER)) {
       media = grl_media_box_new ();
+    } else if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_DOCUMENT)) {
+      media = grl_media_new ();
     }
     i--;
   }
diff --git a/src/media/tracker/grl-tracker-utils.h b/src/media/tracker/grl-tracker-utils.h
index 1fc8819..09cc679 100644
--- a/src/media/tracker/grl-tracker-utils.h
+++ b/src/media/tracker/grl-tracker-utils.h
@@ -29,14 +29,15 @@
 
 /* ------- Definitions ------- */
 
-#define RDF_TYPE_ALBUM  "nmm#MusicAlbum"
-#define RDF_TYPE_ARTIST "nmm#Artist"
-#define RDF_TYPE_AUDIO  "nfo#Audio"
-#define RDF_TYPE_MUSIC  "nmm#MusicPiece"
-#define RDF_TYPE_IMAGE  "nmm#Photo"
-#define RDF_TYPE_VIDEO  "nmm#Video"
-#define RDF_TYPE_FOLDER "nfo#Folder"
-#define RDF_TYPE_BOX    "grilo#Box"
+#define RDF_TYPE_ALBUM    "nmm#MusicAlbum"
+#define RDF_TYPE_ARTIST   "nmm#Artist"
+#define RDF_TYPE_AUDIO    "nfo#Audio"
+#define RDF_TYPE_MUSIC    "nmm#MusicPiece"
+#define RDF_TYPE_IMAGE    "nmm#Photo"
+#define RDF_TYPE_VIDEO    "nmm#Video"
+#define RDF_TYPE_FOLDER   "nfo#Folder"
+#define RDF_TYPE_DOCUMENT "nfo#Document"
+#define RDF_TYPE_BOX      "grilo#Box"
 
 #define RDF_TYPE_VOLUME "tracker#Volume"
 #define RDF_TYPE_UPNP   "upnp#ContentDirectory"



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