[tracker/wip/sam/meson] libtracker-extract: Remove TrackerSparqlBuilder guarantee functions



commit 9fcb9b078052654b6b41bfcf691cce2739ed7eef
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 17 00:23:54 2016 +0200

    libtracker-extract: Remove TrackerSparqlBuilder guarantee functions
    
    Those are not used anymore, and libtracker-extract is private, so...

 src/libtracker-extract/tracker-guarantee.c |  145 +---------------------------
 src/libtracker-extract/tracker-guarantee.h |   10 --
 2 files changed, 1 insertions(+), 154 deletions(-)
---
diff --git a/src/libtracker-extract/tracker-guarantee.c b/src/libtracker-extract/tracker-guarantee.c
index 5c595c9..841b663 100644
--- a/src/libtracker-extract/tracker-guarantee.c
+++ b/src/libtracker-extract/tracker-guarantee.c
@@ -71,149 +71,6 @@ get_date_from_file_mtime (const gchar *uri)
 #endif /* GUARANTEE_METADATA */
 
 /**
- * tracker_guarantee_title_from_file:
- * @metadata: the metadata object to insert the data into
- * @key: the key to insert into @metadata
- * @current_value: the current data to check before looking at @uri.
- * @uri: a string representing a URI to use
- * @p_new_value: pointer to a string which receives the new title, or
- *             %NULL
- *
- * Checks @current_value to make sure it is sane (i.e. not %NULL or an
- * empty string). If it is, then @uri is parsed to guarantee a
- * metadata value for @key.
- *
- * Parses the file pointed to by @uri and uses the basename
- * (before the "." and extension of the file) as the title. If the
- * title has any "_" characters, they are also converted into spaces.
- *
- * This function only operates if Tracker was compiled with
- * --enable-guarantee-metadata enabled at configure-time.
- *
- * Returns: %TRUE on success and content was added to @metadata, otherwise %FALSE.
- *
- * Since: 0.10
- **/
-gboolean
-tracker_guarantee_title_from_file (TrackerSparqlBuilder  *metadata,
-                                   const gchar           *key,
-                                   const gchar           *current_value,
-                                   const gchar           *uri,
-                                   gchar                **p_new_value)
-{
-       gboolean success = TRUE;
-
-#ifdef GUARANTEE_METADATA
-       g_return_val_if_fail (metadata != NULL, FALSE);
-       g_return_val_if_fail (key != NULL, FALSE);
-       g_return_val_if_fail (uri != NULL, FALSE);
-
-       tracker_sparql_builder_predicate (metadata, key);
-
-       if (current_value && *current_value != '\0') {
-               tracker_sparql_builder_object_unvalidated (metadata, current_value);
-
-               if (p_new_value != NULL) {
-                       *p_new_value = g_strdup (current_value);
-               }
-       } else {
-               gchar *value;
-
-               value = get_title_from_file (uri);
-
-               if (value && value[0] != '\0') {
-                       tracker_sparql_builder_object_unvalidated (metadata, value);
-               } else {
-                       success = FALSE;
-               }
-
-               if (p_new_value != NULL) {
-                       *p_new_value = value;
-               } else {
-                       g_free (value);
-               }
-       }
-#else  /* GUARANTEE_METADATA */
-       if (current_value && *current_value != '\0') {
-               tracker_sparql_builder_predicate (metadata, key);
-               tracker_sparql_builder_object_unvalidated (metadata, current_value);
-
-               if (p_new_value != NULL) {
-                       *p_new_value = g_strdup (current_value);
-               }
-       } else {
-               success = FALSE;
-       }
-#endif /* GUARANTEE_METADATA */
-
-       return success;
-}
-
-/**
- * tracker_guarantee_date_from_file_mtime:
- * @metadata: the metadata object to insert the data into
- * @key: the key to insert into @metadata
- * @current_value: the current data to check before looking at @uri
- * @uri: a string representing a URI to use
- *
- * Checks @current_value to make sure it is sane (i.e. not %NULL or an
- * empty string). If it is, then @uri is parsed to guarantee a
- * metadata value for @key.
- *
- * When parsing @uri, stat() is called on the file to create a
- * date based on the file's mtime.
- *
- * This function only operates if Tracker was compiled with
- * --enable-guarantee-metadata enabled at configure-time.
- *
- * Returns: %TRUE on success and content was added to @metadata, otherwise %FALSE.
- *
- * Since: 0.10
- **/
-gboolean
-tracker_guarantee_date_from_file_mtime (TrackerSparqlBuilder *metadata,
-                                        const gchar          *key,
-                                        const gchar          *current_value,
-                                        const gchar          *uri)
-{
-       gboolean success = TRUE;
-
-#ifdef GUARANTEE_METADATA
-       g_return_val_if_fail (metadata != NULL, FALSE);
-       g_return_val_if_fail (key != NULL, FALSE);
-       g_return_val_if_fail (uri != NULL, FALSE);
-
-       tracker_sparql_builder_predicate (metadata, key);
-
-       if (current_value && *current_value != '\0') {
-               tracker_sparql_builder_object_unvalidated (metadata, current_value);
-       } else {
-               gchar *value;
-
-               value = get_date_from_file_mtime (uri);
-
-               if (value && *value != '\0') {
-                       tracker_sparql_builder_object_unvalidated (metadata, value);
-               } else {
-                       success = FALSE;
-               }
-
-               g_free (value);
-       }
-#else  /* GUARANTEE_METADATA */
-       if (current_value && *current_value != '\0') {
-               tracker_sparql_builder_predicate (metadata, key);
-               tracker_sparql_builder_object_unvalidated (metadata, current_value);
-       } else {
-               success = FALSE;
-       }
-#endif /* GUARANTEE_METADATA */
-
-       return success;
-}
-
-
-/**
  * tracker_guarantee_resource_title_from_file:
  * @resource: the relevant #TrackerResource
  * @key: the property URI to set
@@ -247,7 +104,7 @@ tracker_guarantee_resource_title_from_file (TrackerResource  *resource,
        gboolean success = TRUE;
 
 #ifdef GUARANTEE_METADATA
-       g_return_val_if_fail (metadata != NULL, FALSE);
+       g_return_val_if_fail (resource != NULL, FALSE);
        g_return_val_if_fail (key != NULL, FALSE);
        g_return_val_if_fail (uri != NULL, FALSE);
 
diff --git a/src/libtracker-extract/tracker-guarantee.h b/src/libtracker-extract/tracker-guarantee.h
index cdb28c2..6846e80 100644
--- a/src/libtracker-extract/tracker-guarantee.h
+++ b/src/libtracker-extract/tracker-guarantee.h
@@ -30,16 +30,6 @@
 
 G_BEGIN_DECLS
 
-gboolean tracker_guarantee_title_from_file      (TrackerSparqlBuilder  *metadata,
-                                                 const gchar           *key,
-                                                 const gchar           *current_value,
-                                                 const gchar           *uri,
-                                                 gchar                **p_new_value);
-gboolean tracker_guarantee_date_from_file_mtime (TrackerSparqlBuilder *metadata,
-                                                 const gchar          *key,
-                                                 const gchar          *current_value,
-                                                 const gchar          *uri);
-
 gboolean tracker_guarantee_resource_title_from_file      (TrackerResource  *resource,
                                                           const gchar      *key,
                                                           const gchar      *current_value,


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