Add camel_operation_cancel_all().
authorMatthew Barnes <mbarnes@redhat.com>
Sat, 5 Nov 2011 05:00:46 +0000 (01:00 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Sat, 5 Nov 2011 05:00:46 +0000 (01:00 -0400)
Replaces camel_operation_cancel(NULL).

For non-NULL cases, use g_cancellable_cancel() instead.

camel/camel-operation.c
camel/camel-operation.h
camel/providers/imapx/camel-imapx-server.c
docs/reference/camel/camel-sections.txt
docs/reference/camel/tmpl/camel-operation.sgml
docs/reference/camel/tmpl/camel-unused.sgml

index 43825b7..b7a0f22 100644 (file)
@@ -206,37 +206,28 @@ camel_operation_new (void)
 }
 
 /**
- * camel_operation_cancel:
- * @operation: a #CamelOperation
+ * camel_operation_cancel_all:
  *
- * Cancel a given operation.  If @operation is %NULL then all outstanding
- * operations are cancelled.
+ * Cancel all outstanding operations.
  **/
 void
-camel_operation_cancel (CamelOperation *operation)
+camel_operation_cancel_all (void)
 {
-       if (operation != NULL) {
-               g_return_if_fail (CAMEL_IS_OPERATION (operation));
+       GList *link;
 
-               g_cancellable_cancel (G_CANCELLABLE (operation));
-       } else {
-               GList *link;
-
-               LOCK ();
-
-               link = g_queue_peek_head_link (&operation_list);
+       LOCK ();
 
-               while (link != NULL) {
-                       operation = link->data;
+       link = g_queue_peek_head_link (&operation_list);
 
-                       if (operation != NULL)
-                               camel_operation_cancel (operation);
+       while (link != NULL) {
+               GCancellable *cancellable = link->data;
 
-                       link = g_list_next (link);
-               }
+               g_cancellable_cancel (cancellable);
 
-               UNLOCK ();
+               link = g_list_next (link);
        }
+
+       UNLOCK ();
 }
 
 /**
index d14585d..6489755 100644 (file)
@@ -65,10 +65,8 @@ struct _CamelOperationClass {
 };
 
 GType          camel_operation_get_type        (void);
-
-/* main thread functions */
 GCancellable * camel_operation_new             (void);
-void           camel_operation_cancel          (CamelOperation *operation);
+void           camel_operation_cancel_all      (void);
 
 /* Since Camel methods pass around GCancellable pointers instead of
  * CamelOperation pointers, it's more convenient to callers to take
index 24eab1a..3632d60 100644 (file)
@@ -2313,7 +2313,7 @@ imapx_command_idle_stop (CamelIMAPXServer *is,
                is->state = IMAPX_SHUTDOWN;
                is->parser_quit = TRUE;
                if (is->cancellable)
-                       camel_operation_cancel (CAMEL_OPERATION (is->cancellable));
+                       g_cancellable_cancel (is->cancellable);
                return FALSE;
        }
 
index a38c47a..9222e59 100644 (file)
@@ -1732,7 +1732,7 @@ camel_key_table_get_type
 <FILE>camel-operation</FILE>
 CamelOperation
 camel_operation_new
-camel_operation_cancel
+camel_operation_cancel_all
 camel_operation_push_message
 camel_operation_pop_message
 camel_operation_progress
index 09a52ae..f25955d 100644 (file)
@@ -37,12 +37,12 @@ camel-operation
 @Returns: 
 
 
-<!-- ##### FUNCTION camel_operation_cancel ##### -->
+<!-- ##### FUNCTION camel_operation_cancel_all ##### -->
 <para>
 
 </para>
 
-@operation
+@void
 
 
 <!-- ##### FUNCTION camel_operation_push_message ##### -->
index b409223..a4dc572 100644 (file)
@@ -8368,6 +8368,13 @@ streams
 @store: 
 @stay_synchronized: 
 
+<!-- ##### FUNCTION camel_operation_cancel ##### -->
+<para>
+
+</para>
+
+@operation: 
+
 <!-- ##### FUNCTION camel_operation_cancel_block ##### -->
 <para>