[grilo] core: Remove unused function



commit d12292b917b1f4ac6380f20abc10f3edfc59ac36
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Fri Aug 10 12:27:24 2012 +0200

    core: Remove unused function
    
    grl_source_cancel() is not used.
    
    Cancelling is done invoking grl_operation_cancel().

 src/grl-source.c |   49 +------------------------------------------------
 src/grl-source.h |    2 --
 2 files changed, 1 insertions(+), 50 deletions(-)
---
diff --git a/src/grl-source.c b/src/grl-source.c
index ce0b7a4..beceba5 100644
--- a/src/grl-source.c
+++ b/src/grl-source.c
@@ -751,7 +751,7 @@ operation_set_started (guint operation_id)
  * Checks if operation has been started (the operation in plugin has been
  * invoked).
  **/
-static gboolean
+G_GNUC_UNUSED static gboolean
 operation_is_started (guint operation_id)
 {
   struct OperationState *op_state;
@@ -2829,53 +2829,6 @@ grl_source_get_rank (GrlSource *source)
 }
 
 /**
- * grl_source_cancel:
- * @source: a 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.
- */
-void
-grl_source_cancel (GrlSource *source, guint operation_id)
-{
-  GRL_DEBUG (__FUNCTION__);
-
-  g_return_if_fail (GRL_IS_SOURCE (source));
-
-  if (!operation_is_ongoing (operation_id)) {
-    GRL_DEBUG ("Tried to cancel invalid or already cancelled operation. "
-               "Skipping...");
-    return;
-  }
-
-  /* Mark the operation as finished, if the source does not implement
-     cancellation or it did not make it in time, we will not emit the results
-     for this operation in any case.  At any rate, we will not free the
-     operation data until we are sure the plugin won't need it any more. In the
-     case of operations dealing with multiple results, like browse() or
-     search(), this will happen when it emits remaining = 0 (which can be
-     because it did not cancel the op or because it managed to cancel it and is
-     signaling so) */
-  operation_set_cancelled (operation_id);
-
-  /* If the source provides an implementation for operation cancellation,
-     let's use that to avoid further unnecessary processing in the plugin */
-  if (!operation_is_started (operation_id) &&
-      GRL_SOURCE_GET_CLASS (source)->cancel) {
-    GRL_SOURCE_GET_CLASS (source)->cancel (source, operation_id);
-  }
-}
-
-/**
  * grl_source_supported_operations:
  * @source: a source
  *
diff --git a/src/grl-source.h b/src/grl-source.h
index 4f8e44c..be31156 100644
--- a/src/grl-source.h
+++ b/src/grl-source.h
@@ -618,8 +618,6 @@ void grl_source_notify_change (GrlSource *source,
                                GrlSourceChangeType change_type,
                                gboolean location_unknown);
 
-void grl_source_cancel (GrlSource *source, guint operation_id);
-
 const gchar *grl_source_get_id (GrlSource *source);
 
 const gchar *grl_source_get_name (GrlSource *source);



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