[grilo-plugins] tracker: limit sources to volumes and upnp servers



commit 8c1eb12abce6e81b48dd8e11202d33da3100fe6d
Author: Lionel Landwerlin <lionel g landwerlin linux intel com>
Date:   Sun Apr 10 11:41:45 2011 +0100

    tracker: limit sources to volumes and upnp servers
    
    Signed-off-by: Lionel Landwerlin <lionel g landwerlin linux intel com>

 src/media/tracker/grl-tracker-media-notif.c |    6 ++++--
 src/media/tracker/grl-tracker-media.c       |   24 +++++++++++++-----------
 src/media/tracker/grl-tracker-utils.c       |    5 -----
 3 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/src/media/tracker/grl-tracker-media-notif.c b/src/media/tracker/grl-tracker-media-notif.c
index e3297cd..5cda05f 100644
--- a/src/media/tracker/grl-tracker-media-notif.c
+++ b/src/media/tracker/grl-tracker-media-notif.c
@@ -451,8 +451,10 @@ tracker_evt_preupdate_sources_item_cb (GObject              *object,
       gchar *source_name = grl_tracker_get_media_name (type, uri, datasource,
                                                        datasource_name);
       /* Defer source creation until we have processed all sources */
-      tracker_evt_update_media_add (evt, datasource, source_name);
-      g_free (source_name);
+      if (source_name) {
+        tracker_evt_update_media_add (evt, datasource, source_name);
+        g_free (source_name);
+      }
     } else {
       GRL_DEBUG ("\tChanges on source %p / %s", source, datasource);
     }
diff --git a/src/media/tracker/grl-tracker-media.c b/src/media/tracker/grl-tracker-media.c
index 84dd299..ca17dd6 100644
--- a/src/media/tracker/grl-tracker-media.c
+++ b/src/media/tracker/grl-tracker-media.c
@@ -352,17 +352,19 @@ tracker_get_datasource_cb (GObject             *object,
   if ((source == NULL) && source_available) {
     gchar *source_name = grl_tracker_get_media_name (type, uri, datasource,
                                                      datasource_name);
-    GRL_DEBUG ("\tnew datasource: urn=%s name=%s uri=%s => name=%s\n",
-	       datasource, datasource_name, uri, source_name);
-    source = g_object_new (GRL_TRACKER_MEDIA_TYPE,
-                           "source-id", datasource,
-                           "source-name", source_name,
-                           "source-desc", GRL_TRACKER_MEDIA_DESC,
-                           "tracker-connection", grl_tracker_connection,
-                           "tracker-datasource", datasource,
-                           NULL);
-    grl_tracker_add_source (source);
-    g_free (source_name);
+    if (source_name) {
+      GRL_DEBUG ("\tnew datasource: urn=%s name=%s uri=%s => name=%s\n",
+                 datasource, datasource_name, uri, source_name);
+      source = g_object_new (GRL_TRACKER_MEDIA_TYPE,
+                             "source-id", datasource,
+                             "source-name", source_name,
+                             "source-desc", GRL_TRACKER_MEDIA_DESC,
+                             "tracker-connection", grl_tracker_connection,
+                             "tracker-datasource", datasource,
+                             NULL);
+      grl_tracker_add_source (source);
+      g_free (source_name);
+    }
   }
 
   tracker_sparql_cursor_next_async (cursor, NULL,
diff --git a/src/media/tracker/grl-tracker-utils.c b/src/media/tracker/grl-tracker-utils.c
index 632fa28..a038941 100644
--- a/src/media/tracker/grl-tracker-utils.c
+++ b/src/media/tracker/grl-tracker-utils.c
@@ -617,11 +617,6 @@ grl_tracker_get_media_name (const gchar *rdf_type,
 
   g_strfreev (rdf_single_type);
 
-  if (!source_name)
-    source_name = g_strdup_printf  ("%s %s",
-                                    GRL_TRACKER_MEDIA_NAME,
-                                    datasource);
-
   return source_name;
 }
 



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