[PATCH 07/15] core: use GrlOperationOptions in grl_metadata_source_resolve()



From: Guillaume Emont <gemont igalia com>

---
 src/grl-metadata-source.c |   17 +++++++++--------
 src/grl-metadata-source.h |    6 +++---
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/grl-metadata-source.c b/src/grl-metadata-source.c
index a28291c..e2122de 100644
--- a/src/grl-metadata-source.c
+++ b/src/grl-metadata-source.c
@@ -850,8 +850,7 @@ grl_metadata_source_may_resolve (GrlMetadataSource *source,
  * @keys: (element-type GrlKeyID) (allow-none): the #GList
  * of #GrlKeyID to retrieve
  * @media: Transfer object where all the metadata is stored.
- * @flags: bitwise mask of #GrlMetadataResolutionFlags with the resolution
- * strategy
+ * @options: options to pass to this operation
  * @callback: (scope notified): the callback to execute when the @media metadata is filled up
  * @user_data: user data set for the @callback
  *
@@ -868,7 +867,7 @@ guint
 grl_metadata_source_resolve (GrlMetadataSource *source,
                              const GList *keys,
                              GrlMedia *media,
-                             GrlMetadataResolutionFlags flags,
+                             GrlOperationOptions *options,
                              GrlMetadataSourceResolveCb callback,
                              gpointer user_data)
 {
@@ -876,6 +875,7 @@ grl_metadata_source_resolve (GrlMetadataSource *source,
   GList *_keys;
   struct ResolveRelayCb *rrc;
   guint resolve_id;
+  GrlMetadataResolutionFlags flags;
 
   GRL_DEBUG ("grl_metadata_source_resolve");
 
@@ -887,6 +887,8 @@ grl_metadata_source_resolve (GrlMetadataSource *source,
 
   _keys = g_list_copy ((GList *) keys);
 
+  flags = grl_operation_options_get_flags (options);
+
   if (flags & GRL_RESOLVE_FAST_ONLY) {
     grl_metadata_source_filter_slow (source, &_keys, FALSE);
   }
@@ -905,7 +907,7 @@ grl_metadata_source_resolve (GrlMetadataSource *source,
   rs->resolve_id = resolve_id;
   rs->keys = _keys;
   rs->media = g_object_ref (media);
-  rs->flags = flags;
+  rs->options = options;
   rs->callback = resolve_result_relay_cb;
   rs->user_data = rrc;
 
@@ -929,8 +931,7 @@ grl_metadata_source_resolve (GrlMetadataSource *source,
  * @keys: (element-type GrlKeyID) (allow-none): the #GList
  * of #GrlKeyID to retrieve
  * @media: Transfer object where all the metadata is stored
- * @flags: bitwise mask of #GrlMetadataResolutionFlags with the resolution
- * strategy
+ * @options: options to pass to this operation
  * @error: a #GError, or @NULL
  *
  * This is the main method of the #GrlMetadataSource class. It will fetch the
@@ -946,7 +947,7 @@ GrlMedia *
 grl_metadata_source_resolve_sync (GrlMetadataSource *source,
                                   const GList *keys,
                                   GrlMedia *media,
-                                  GrlMetadataResolutionFlags flags,
+                                  GrlOperationOptions *options,
                                   GError **error)
 {
   GrlDataSync *ds;
@@ -956,7 +957,7 @@ grl_metadata_source_resolve_sync (GrlMetadataSource *source,
   grl_metadata_source_resolve (source,
                                keys,
                                media,
-                               flags,
+                               options,
                                resolve_result_async_cb,
                                ds);
 
diff --git a/src/grl-metadata-source.h b/src/grl-metadata-source.h
index a0505d7..37764fe 100644
--- a/src/grl-metadata-source.h
+++ b/src/grl-metadata-source.h
@@ -148,7 +148,7 @@ typedef struct {
   guint resolve_id;
   GList *keys;
   GrlMedia *media;
-  GrlMetadataResolutionFlags flags;
+  GrlOperationOptions *options;
   GrlMetadataSourceResolveCb callback;
   gpointer user_data;
 
@@ -300,14 +300,14 @@ gboolean grl_metadata_source_may_resolve (GrlMetadataSource *source,
 guint grl_metadata_source_resolve (GrlMetadataSource *source,
                                    const GList *keys,
                                    GrlMedia *media,
-                                   GrlMetadataResolutionFlags flags,
+                                   GrlOperationOptions *options,
                                    GrlMetadataSourceResolveCb callback,
                                    gpointer user_data);
 
 GrlMedia *grl_metadata_source_resolve_sync (GrlMetadataSource *source,
                                             const GList *keys,
                                             GrlMedia *media,
-                                            GrlMetadataResolutionFlags flags,
+                                            GrlOperationOptions *options,
                                             GError **error);
 
 void grl_metadata_source_set_metadata (GrlMetadataSource *source,
-- 
1.7.5.4



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