[grilo-plugins/wip/mschraal/tracker-source-cleanup-unused: 3/3] tracker: Remove obsolete functions



commit d942d6e22675ef875d4b531b58dae56affb8bb99
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed Feb 19 22:59:06 2020 +0100

    tracker: Remove obsolete functions

 src/tracker/grl-tracker-source.c | 17 ---------
 src/tracker/grl-tracker-source.h |  2 --
 src/tracker/grl-tracker-utils.c  | 75 ----------------------------------------
 src/tracker/grl-tracker-utils.h  |  5 ---
 4 files changed, 99 deletions(-)
---
diff --git a/src/tracker/grl-tracker-source.c b/src/tracker/grl-tracker-source.c
index 112f728c..fd821e6c 100644
--- a/src/tracker/grl-tracker-source.c
+++ b/src/tracker/grl-tracker-source.c
@@ -228,23 +228,6 @@ grl_tracker_add_source (GrlTrackerSource *source)
                                 NULL);
 }
 
-void
-grl_tracker_del_source (GrlTrackerSource *source)
-{
-  GrlTrackerSourcePriv *priv = GRL_TRACKER_SOURCE_GET_PRIVATE (source);
-
-  GRL_DEBUG ("==================>del source '%s'",
-             grl_source_get_name (GRL_SOURCE (source)));
-
-  g_hash_table_remove (grl_tracker_source_sources,
-                       grl_tracker_source_get_tracker_source (source));
-  grl_tracker_source_cache_del_source (grl_tracker_item_cache, source);
-  priv->state = GRL_TRACKER_SOURCE_STATE_DELETED;
-  grl_registry_unregister_source (grl_registry_get_default (),
-                                  GRL_SOURCE (source),
-                                  NULL);
-}
-
 gboolean
 grl_tracker_source_can_notify (GrlTrackerSource *source)
 {
diff --git a/src/tracker/grl-tracker-source.h b/src/tracker/grl-tracker-source.h
index a6157263..8158cb04 100644
--- a/src/tracker/grl-tracker-source.h
+++ b/src/tracker/grl-tracker-source.h
@@ -88,8 +88,6 @@ void grl_tracker_source_sources_init (void);
 
 void grl_tracker_add_source (GrlTrackerSource *source);
 
-void grl_tracker_del_source (GrlTrackerSource *source);
-
 GrlTrackerSource *grl_tracker_source_find (const gchar *id);
 
 GrlTrackerSource *grl_tracker_source_find_source (const gchar *id);
diff --git a/src/tracker/grl-tracker-utils.c b/src/tracker/grl-tracker-utils.c
index 14cea8af..3ec154db 100644
--- a/src/tracker/grl-tracker-utils.c
+++ b/src/tracker/grl-tracker-utils.c
@@ -807,81 +807,6 @@ grl_tracker_build_grilo_media (const gchar   *rdf_type,
 
 /**/
 
-static gchar *
-get_tracker_volume_name (const gchar *uri,
-                        const gchar *datasource)
-{
-  gchar *source_name = NULL;
-  GVolumeMonitor *volume_monitor;
-  GList *mounts, *mount;
-  GFile *file;
-
-  if (uri != NULL && *uri != '\0') {
-    volume_monitor = g_volume_monitor_get ();
-    mounts = g_volume_monitor_get_mounts (volume_monitor);
-    file = g_file_new_for_uri (uri);
-
-    mount = mounts;
-    while (mount != NULL) {
-      GFile *m_file = g_mount_get_root (G_MOUNT (mount->data));
-
-      if (g_file_equal (m_file, file)) {
-        gchar *m_name = g_mount_get_name (G_MOUNT (mount->data));
-        g_object_unref (G_OBJECT (m_file));
-        source_name = g_strdup_printf (_("Removable — %s"), m_name);
-        g_free (m_name);
-        break;
-      }
-      g_object_unref (G_OBJECT (m_file));
-
-      mount = mount->next;
-    }
-    g_list_free_full (mounts, g_object_unref);
-    g_object_unref (G_OBJECT (file));
-    g_object_unref (G_OBJECT (volume_monitor));
-  } else {
-    source_name = g_strdup (_("Local files"));
-  }
-
-  return source_name;
-}
-
-static gchar *
-get_tracker_upnp_name (const gchar *datasource_name)
-{
-  return g_strdup_printf ("UPnP — %s", datasource_name);
-}
-
-gchar *
-grl_tracker_get_source_name (const gchar *rdf_type,
-                             const gchar *uri,
-                             const gchar *datasource,
-                             const gchar *datasource_name)
-{
-  gchar *source_name = NULL;
-  gchar **rdf_single_type;
-  gint i;
-
-  /* As rdf_type can be formed by several types, split them */
-  rdf_single_type = g_strsplit (rdf_type, ",", -1);
-  i = g_strv_length (rdf_single_type) - 1;
-
-  while (i >= 0) {
-    if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_VOLUME)) {
-      source_name = get_tracker_volume_name (uri, datasource);
-      break;
-    } else if (g_str_has_suffix (rdf_single_type[i], RDF_TYPE_UPNP)) {
-      source_name = get_tracker_upnp_name (datasource_name);
-      break;
-    }
-    i--;
-  }
-
-  g_strfreev (rdf_single_type);
-
-  return source_name;
-}
-
 const GList *
 grl_tracker_supported_keys (GrlSource *source)
 {
diff --git a/src/tracker/grl-tracker-utils.h b/src/tracker/grl-tracker-utils.h
index bf6c0ef5..35ef0939 100644
--- a/src/tracker/grl-tracker-utils.h
+++ b/src/tracker/grl-tracker-utils.h
@@ -87,9 +87,4 @@ gchar *grl_tracker_get_delete_string (const GList *keys);
 gchar *grl_tracker_get_delete_conditional_string (const gchar *urn,
                                                   const GList *keys);
 
-gchar *grl_tracker_get_source_name (const gchar *rdf_type,
-                                    const gchar *uri,
-                                    const gchar *datasource,
-                                    const gchar *datasource_name);
-
 #endif /* _GRL_TRACKER_UTILS_H_ */


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