[grilo] core: Get rid of deprecated functions



commit 208dfd72fa02565acddfb075ea5ac4ce32f5a8ba
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri May 27 10:20:06 2011 +0000

    core: Get rid of deprecated functions
    
    Start from scratch in 0.2.x release cycle.
    
    Signed-off-by: Juan A. Suarez Romero <jasuarez igalia com>

 src/data/grl-data.c         |  183 -------------------------------------------
 src/data/grl-data.h         |   12 ---
 src/data/grl-related-keys.c |   41 ----------
 src/data/grl-related-keys.h |    6 --
 src/grl-media-source.c      |   87 --------------------
 src/grl-media-source.h      |    8 --
 src/grl-metadata-source.c   |   62 +--------------
 src/grl-metadata-source.h   |    6 --
 8 files changed, 1 insertions(+), 404 deletions(-)
---
diff --git a/src/data/grl-data.c b/src/data/grl-data.c
index bcc8987..d56cc32 100644
--- a/src/data/grl-data.c
+++ b/src/data/grl-data.c
@@ -40,25 +40,10 @@
 #define GRL_LOG_DOMAIN_DEFAULT data_log_domain
 GRL_LOG_DOMAIN(data_log_domain);
 
-enum {
-  PROP_0,
-  PROP_OVERWRITE
-};
-
 struct _GrlDataPrivate {
   GHashTable *data;
 };
 
-static void grl_data_set_property (GObject *object,
-                                   guint prop_id,
-                                   const GValue *value,
-                                           GParamSpec *pspec);
-
-static void grl_data_get_property (GObject *object,
-                                   guint prop_id,
-                                   GValue *value,
-                                   GParamSpec *pspec);
-
 static void grl_data_finalize (GObject *object);
 static void free_list_values (GrlKeyID key, GList *values, gpointer user_data);
 
@@ -76,19 +61,9 @@ grl_data_class_init (GrlDataClass *klass)
 {
   GObjectClass *gobject_class = (GObjectClass *)klass;
 
-  gobject_class->set_property = grl_data_set_property;
-  gobject_class->get_property = grl_data_get_property;
   gobject_class->finalize = grl_data_finalize;
 
   g_type_class_add_private (klass, sizeof (GrlDataPrivate));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_OVERWRITE,
-                                   g_param_spec_boolean ("overwrite",
-                                                         "Overwrite",
-                                                         "Overwrite current values",
-                                                         TRUE,
-                                                         G_PARAM_READWRITE));
 }
 
 static void
@@ -115,40 +90,6 @@ grl_data_finalize (GObject *object)
   G_OBJECT_CLASS (grl_data_parent_class)->finalize (object);
 }
 
-static void
-grl_data_set_property (GObject *object,
-                       guint prop_id,
-                       const GValue *value,
-                       GParamSpec *pspec)
-{
-  switch (prop_id) {
-  case PROP_OVERWRITE:
-    g_warning ("\"overwrite\" property is deprecated");
-
-  default:
-    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    break;
-  }
-}
-
-static void
-grl_data_get_property (GObject *object,
-                       guint prop_id,
-                       GValue *value,
-                       GParamSpec *pspec)
-{
-  switch (prop_id) {
-  case PROP_OVERWRITE:
-    g_warning ("\"overwrite\" property is deprecated");
-    g_value_set_boolean (value, TRUE);
-    break;
-
-  default:
-    G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-    break;
-  }
-}
-
 /* ================ Utitilies ================ */
 
 /* Free the list of values, which are of type #GrlRelatedKeys */
@@ -475,24 +416,6 @@ grl_data_get_binary(GrlData *data, GrlKeyID key, gsize *size)
 }
 
 /**
- * grl_data_add:
- * @data: data to change
- * @key: (type GrlKeyID): key to add
- *
- * Adds a new @key to @data, with no value. If key already exists, it does
- * nothing.
- *
- * Since: 0.1.4
- * Deprecated: 0.1.13: Use grl_data_add_related_keys() instead
- **/
-void
-grl_data_add (GrlData *data, GrlKeyID key)
-{
-  GRL_WARNING ("grl_data_add() is deprecated. Added keys require a value. "
-               "Use instead grl_data_set()");
-}
-
-/**
  * grl_data_remove:
  * @data: data to change
  * @key: (type GrlKeyID): key to remove
@@ -585,27 +508,6 @@ grl_data_get_keys (GrlData *data)
 }
 
 /**
- * grl_data_key_is_known:
- * @data: data to inspect
- * @key: (type GrlKeyID): key to search
- *
- * Checks if the @key has a first value in @data.
- *
- * Returns: %TRUE if key has a value.
- *
- * Since: 0.1.4
- * Deprecated: 0.1.13: Use grl_data_has_key() instead
- **/
-gboolean
-grl_data_key_is_known (GrlData *data, GrlKeyID key)
-{
-  GRL_WARNING ("grl_data_key_is_known() is deprecated. "
-               "Use instead grl_data_has_key()");
-
-  return grl_data_has_key (data, key);
-}
-
-/**
  * grl_data_add_related_keys:
  * @data: data to change
  * @relkeys: a set of related properties with their values
@@ -833,29 +735,6 @@ grl_data_get_related_keys (GrlData *data,
 }
 
 /**
- * grl_data_get_all_single_related_keys:
- * @data: a data
- * @key: a metadata key
- *
- * Returns all non-%NULL values for @key from @data. This ignores related keys.
- *
- * Returns: (element-type GObject.Value) (transfer container): a #GList with
- * values. Do not change or free the values. Free the list with #g_list_free.
- *
- * Since: 0.1.10
- * Deprecated: 0.1.13: Use grl_data_get_single_values_for_key() instead
- **/
-GList *
-grl_data_get_all_single_related_keys (GrlData *data,
-                                      GrlKeyID key)
-{
-  GRL_WARNING ("grl_data_get_all_single_related_keys() is deprecated. "
-               "Use instead grl_data_get_single_values_for_key()");
-
-  return grl_data_get_single_values_for_key (data, key);
-}
-
-/**
  * grl_data_get_single_values_for_key:
  * @data: a data
  * @key: a metadata key
@@ -898,30 +777,6 @@ grl_data_get_single_values_for_key (GrlData *data,
 }
 
 /**
- * grl_data_get_all_single_related_keys_string:
- * @data: a data
- * @key: a metadata key
- *
- * Returns all non-%NULL values for @key from @data. @key must have been
- * registered as a string-type key. This ignores related keys.
- *
- * Returns: (element-type utf8) (transfer container): a #GList with values. Do
- * not change or free the strings. Free the list with #g_list_free.
- *
- * Since: 0.1.10
- * Deprecated: 0.1.13: Use grl_data_get_single_values_for_key_string() instead
- **/
-GList *
-grl_data_get_all_single_related_keys_string (GrlData *data,
-                                             GrlKeyID key)
-{
-  GRL_WARNING ("grl_data_get_all_single_related_keys_string() is deprecated. "
-               "Use instead grl_data_get_single_values_for_key_string()");
-
-  return grl_data_get_single_values_for_key_string (data, key);
-}
-
-/**
  * grl_data_get_single_values_for_key_string:
  * @data: a data
  * @key: a metadata key
@@ -1101,41 +956,3 @@ grl_data_dup (GrlData *data)
 
   return dup_data;
 }
-
-/**
- * grl_data_set_overwrite:
- * @data: data to change
- * @overwrite: if data can be overwritten
- *
- * This controls if #grl_data_set will overwrite the current value of a property
- * with the new one.
- *
- * Set it to %TRUE so old values are overwritten, or %FALSE in other case
- * (default is %FALSE).
- *
- * Since: 0.1.4
- * Deprecated: 0.1.13
- **/
-void
-grl_data_set_overwrite (GrlData *data, gboolean overwrite)
-{
-  GRL_WARNING ("\"overwrite\" property is deprecated");
-}
-
-/**
- * grl_data_get_overwrite:
- * @data: data to inspect
- *
- * Checks if old values are replaced when calling #grl_data_set.
- *
- * Returns: %TRUE if values will be overwritten.
- *
- * Since: 0.1.4
- * Deprecated: 0.1.13
- **/
-gboolean
-grl_data_get_overwrite (GrlData *data)
-{
-  GRL_WARNING ("\"overwrite\" property is deprecated");
-  return TRUE;
-}
diff --git a/src/data/grl-data.h b/src/data/grl-data.h
index 4c4b45b..e1b7f26 100644
--- a/src/data/grl-data.h
+++ b/src/data/grl-data.h
@@ -118,16 +118,12 @@ gfloat grl_data_get_float (GrlData *data, GrlKeyID key);
 
 const guint8 *grl_data_get_binary(GrlData *data, GrlKeyID key, gsize *size);
 
-G_GNUC_DEPRECATED void grl_data_add (GrlData *data, GrlKeyID key);
-
 void grl_data_remove (GrlData *data, GrlKeyID key);
 
 gboolean grl_data_has_key (GrlData *data, GrlKeyID key);
 
 GList *grl_data_get_keys (GrlData *data);
 
-G_GNUC_DEPRECATED gboolean grl_data_key_is_known (GrlData *data, GrlKeyID key);
-
 void grl_data_add_related_keys (GrlData *data, GrlRelatedKeys *relkeys);
 
 void grl_data_add_string (GrlData *data, GrlKeyID key, const gchar *strvalue);
@@ -142,12 +138,8 @@ guint grl_data_length (GrlData *data, GrlKeyID key);
 
 GrlRelatedKeys *grl_data_get_related_keys (GrlData *data, GrlKeyID key, guint index);
 
-G_GNUC_DEPRECATED GList *grl_data_get_all_single_related_keys (GrlData *data, GrlKeyID key);
-
 GList *grl_data_get_single_values_for_key (GrlData *data, GrlKeyID key);
 
-G_GNUC_DEPRECATED GList *grl_data_get_all_single_related_keys_string (GrlData *data, GrlKeyID key);
-
 GList *grl_data_get_single_values_for_key_string (GrlData *data, GrlKeyID key);
 
 void grl_data_remove_nth (GrlData *data, GrlKeyID key, guint index);
@@ -156,10 +148,6 @@ void grl_data_set_related_keys (GrlData *data, GrlRelatedKeys *relkeys, guint in
 
 GrlData *grl_data_dup (GrlData *data);
 
-G_GNUC_DEPRECATED void grl_data_set_overwrite (GrlData *data, gboolean overwrite);
-
-G_GNUC_DEPRECATED gboolean grl_data_get_overwrite (GrlData *data);
-
 G_END_DECLS
 
 #endif /* _GRL_DATA_H_ */
diff --git a/src/data/grl-related-keys.c b/src/data/grl-related-keys.c
index afd0057..112daaf 100644
--- a/src/data/grl-related-keys.c
+++ b/src/data/grl-related-keys.c
@@ -483,25 +483,6 @@ grl_related_keys_get_binary (GrlRelatedKeys *relkeys,
 }
 
 /**
- * grl_related_keys_add:
- * @relkeys: set of related keys to change
- * @key: (type GrlKeyID): key to add
- *
- * Adds a new @key to @relkeys, with no value. If @key already exists, it does
- * nothing.
- *
- * Since: 0.1.10
- * Deprecated: 0.1.13: Use grl_related_keys_set() instead
- **/
-void
-grl_related_keys_add (GrlRelatedKeys *relkeys,
-                      GrlKeyID key)
-{
-  GRL_WARNING ("grl_related_keys_add() is deprecated. Added key requires a value. "
-               "Use instead grl_related_keys_set()");
-}
-
-/**
  * grl_related_keys_has_key:
  * @relkeys: set of related keys to inspect
  * @key: (type GrlKeyID): key to search
@@ -544,28 +525,6 @@ grl_related_keys_get_keys (GrlRelatedKeys *relkeys)
 }
 
 /**
- * grl_related_keys_key_is_known:
- * @relkeys: set of related keys to inspect
- * @key: (type GrlKeyID): key to search
- *
- * Checks if @key has a value in @relkeys.
- *
- * Returns: %TRUE if @key has a value.
- *
- * Since: 0.1.10
- * Deprecated: 0.1.13: Use grl_related_keys_has_key() instead
- **/
-gboolean
-grl_related_keys_key_is_known (GrlRelatedKeys *relkeys,
-                               GrlKeyID key)
-{
-  GRL_WARNING ("grl_related_keys_key_is_known() is deprecated. "
-               "Use instead grl_related_keys_has_key()");
-
-  return grl_related_keys_has_key (relkeys, key);
-}
-
-/**
  * grl_related_keys_dup:
  * @relkeys: set of related keys to duplicate
  *
diff --git a/src/data/grl-related-keys.h b/src/data/grl-related-keys.h
index e3c5ff8..cb781d9 100644
--- a/src/data/grl-related-keys.h
+++ b/src/data/grl-related-keys.h
@@ -134,17 +134,11 @@ const guint8 *grl_related_keys_get_binary(GrlRelatedKeys *relkeys,
                                           GrlKeyID key,
                                           gsize *size);
 
-G_GNUC_DEPRECATED void grl_related_keys_add (GrlRelatedKeys *relkeys,
-                                            GrlKeyID key);
-
 gboolean grl_related_keys_has_key (GrlRelatedKeys *relkeys,
                                    GrlKeyID key);
 
 GList *grl_related_keys_get_keys (GrlRelatedKeys *relkeys);
 
-G_GNUC_DEPRECATED gboolean grl_related_keys_key_is_known (GrlRelatedKeys *relkeys,
-                                                          GrlKeyID key);
-
 GrlRelatedKeys *grl_related_keys_dup (GrlRelatedKeys *relkeys);
 
 G_END_DECLS
diff --git a/src/grl-media-source.c b/src/grl-media-source.c
index 04610b7..66664c7 100644
--- a/src/grl-media-source.c
+++ b/src/grl-media-source.c
@@ -2127,93 +2127,6 @@ grl_media_source_supported_operations (GrlMetadataSource *metadata_source)
 }
 
 /**
- * grl_media_source_cancel:
- * @source: a media source
- * @operation_id: the identifier of the running operation, as returned by the
- * function that started it
- *
- * Cancel a running method.
- *
- * The derived class must implement the cancel vmethod in order to honour the
- * request correctly. Otherwise, the operation will not be interrupted.
- *
- * In all cases, if this function is called on an ongoing operation, the
- * corresponding callback will be called with the
- * @GRL_CORE_ERROR_OPERATION_CANCELLED error set, and no more action will be
- * taken for that operation after the said callback with error has been called.
- *
- * Since: 0.1.1
- * Deprecated: 0.1.14: Use grl_metadata_source_cancel() instead
- */
-void
-grl_media_source_cancel (GrlMediaSource *source, guint operation_id)
-{
-  GRL_DEBUG ("grl_media_source_cancel");
-
-  g_return_if_fail (GRL_IS_MEDIA_SOURCE (source));
-
-  GRL_WARNING ("grl_media_source_cancel() is deprecated. "
-               "Use grl_metadata_source_cancel() instead");
-
-  grl_metadata_source_cancel (GRL_METADATA_SOURCE (source), operation_id);
-}
-
-/**
- * grl_media_source_set_operation_data:
- * @source: a media source
- * @operation_id: the identifier of a running operation
- * @data: the data to attach
- *
- * Attach a pointer to the specific operation.
- *
- * Since: 0.1.1
- * Deprecated: 0.1.14: Use grl_metadata_source_set_operation_data() instead
- */
-void
-grl_media_source_set_operation_data (GrlMediaSource *source,
-                                     guint operation_id,
-                                     gpointer data)
-{
-  GRL_DEBUG ("grl_media_source_set_operation_data");
-
-  g_return_if_fail (GRL_IS_MEDIA_SOURCE (source));
-
-  GRL_WARNING ("grl_media_source_set_operation_data() is deprecated. "
-               "Use instead grl_metadata_source_set_operation_data()");
-
-  grl_metadata_source_set_operation_data (GRL_METADATA_SOURCE (source),
-                                          operation_id,
-                                          data);
-}
-
-/**
- * grl_media_source_get_operation_data:
- * @source: a media source
- * @operation_id: the identifier of a running operation
- *
- * Obtains the previously attached data
- *
- * Returns: (transfer none): The previously attached data.
- *
- * Since: 0.1.1
- * Deprecated: 0.1.14: Use grl_metadata_source_get_operation_data() instead
- */
-gpointer
-grl_media_source_get_operation_data (GrlMediaSource *source,
-                                     guint operation_id)
-{
-  GRL_DEBUG ("grl_media_source_get_operation_data");
-
-  g_return_val_if_fail (GRL_IS_MEDIA_SOURCE (source), NULL);
-
-  GRL_WARNING ("grl_metadata_source_get_operation_data() is deprecated. "
-               "Use instead grl_metadata_source_get_operation_data()");
-
-  return grl_metadata_source_get_operation_data (GRL_METADATA_SOURCE (source),
-                                                 operation_id);
-}
-
-/**
  * grl_media_source_get_auto_split_threshold:
  * @source: a media source
  *
diff --git a/src/grl-media-source.h b/src/grl-media-source.h
index 02f43ad..2b982b6 100644
--- a/src/grl-media-source.h
+++ b/src/grl-media-source.h
@@ -497,14 +497,6 @@ void grl_media_source_remove_sync (GrlMediaSource *source,
                                    GError **error);
 
 
-G_GNUC_DEPRECATED void grl_media_source_cancel (GrlMediaSource *source, guint operation_id);
-
-G_GNUC_DEPRECATED void grl_media_source_set_operation_data (GrlMediaSource *source,
-                                                            guint operation_id,
-                                                            gpointer data);
-
-G_GNUC_DEPRECATED gpointer grl_media_source_get_operation_data (GrlMediaSource *source,
-                                                                guint operation_id);
 
 void grl_media_source_set_auto_split_threshold (GrlMediaSource *source,
                                                 guint threshold);
diff --git a/src/grl-metadata-source.c b/src/grl-metadata-source.c
index 8a29f3b..65b9d0e 100644
--- a/src/grl-metadata-source.c
+++ b/src/grl-metadata-source.c
@@ -754,34 +754,6 @@ grl_metadata_source_slow_keys (GrlMetadataSource *source)
 }
 
 /**
- * grl_metadata_source_key_depends:
- * @source: a metadata source
- * @key_id: (type GrlKeyID): the requested metadata key
- *
- * Get the list of #GrlKeyID which are needed a priori, in order to fetch
- * and store the requested @key_id
- *
- * Returns: (element-type GrlKeyID) (transfer none):
- * a #GList with the keys, or @NULL if it can not resolve @key_id
- *
- * Since: 0.1.1
- * Deprecated: 0.1.10: use grl_metadata_source_may_resolve() instead.
- */
-const GList *
-grl_metadata_source_key_depends (GrlMetadataSource *source, GrlKeyID key_id)
-{
-  GRL_WARNING ("grl_metadata_source_key_depends() is deprecated, caller "
-               "should use grl_metadata_source_may_resolve() instead.");
-  g_return_val_if_fail (GRL_IS_METADATA_SOURCE (source), NULL);
-
-  if (GRL_METADATA_SOURCE_GET_CLASS (source)->key_depends) {
-    return GRL_METADATA_SOURCE_GET_CLASS (source)->key_depends (source, key_id);
-  } else {
-    return NULL;
-  }
-}
-
-/**
  * grl_metadata_source_writable_keys:
  * @source: a metadata source
  *
@@ -846,39 +818,7 @@ grl_metadata_source_may_resolve (GrlMetadataSource *source,
     return klass->may_resolve (source, media, key_id, missing_keys);
   }
 
-  if (klass->key_depends) {
-    /* compatibility code, to be removed when we get rid of key_depends() */
-    const GList *deps;
-    GList *missing;
-
-    GRL_WARNING ("Source %s should implement the may_resolve() vmethod, trying "
-                 "with the deprecated key_depends() vmethod instead",
-                 grl_metadata_source_get_name (source));
-
-    deps = klass->key_depends (source, key_id);
-
-    if (!deps)
-      return FALSE;
-
-
-    if (media)
-      missing = missing_in_data (GRL_DATA (media), deps);
-    else
-      missing = g_list_copy ((GList *)deps);
-
-    if (missing) {
-      ret = FALSE;
-      if (missing_keys) {
-        *missing_keys = missing;
-        missing = NULL;
-      }
-    } else {
-      ret = TRUE;
-    }
-
-    if (missing)
-      g_list_free (missing);
-  } else if (GRL_IS_MEDIA_SOURCE (source)) {
+  if (GRL_IS_MEDIA_SOURCE (source)) {
     /* We're more forgiving to media source, as we should only ask them keys
      * during a media source operation, and we assume they are likely to return
      * all of their supported_keys() in that case. If a media source wants to
diff --git a/src/grl-metadata-source.h b/src/grl-metadata-source.h
index a0640c9..712794f 100644
--- a/src/grl-metadata-source.h
+++ b/src/grl-metadata-source.h
@@ -240,7 +240,6 @@ typedef struct _GrlMetadataSourceClass GrlMetadataSourceClass;
  * @supported_operations: the operations that can be called
  * @supported_keys: the list of keys that can be handled
  * @slow_keys: the list of slow keys that can be fetched
- * @key_depends: a deprecated vmethod that will be removed in the future
  * @writable_keys: the list of keys which value can be written
  * @resolve: resolve the metadata of a given transfer object
  * @set_metadata: update metadata values for a given object in a
@@ -266,8 +265,6 @@ struct _GrlMetadataSourceClass {
 
   const GList * (*slow_keys) (GrlMetadataSource *source);
 
-  const GList * (*key_depends) (GrlMetadataSource *source, GrlKeyID key_id);
-
   const GList * (*writable_keys) (GrlMetadataSource *source);
 
   void (*resolve) (GrlMetadataSource *source,
@@ -307,9 +304,6 @@ GList *grl_metadata_source_filter_writable (GrlMetadataSource *source,
 					    GList **keys,
 					    gboolean return_filtered);
 
-const GList *grl_metadata_source_key_depends (GrlMetadataSource *source,
-                                              GrlKeyID key_id);
-
 const GList *grl_metadata_source_writable_keys (GrlMetadataSource *source);
 
 gboolean grl_metadata_source_may_resolve (GrlMetadataSource *source,



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