}
/**
- * 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 ();
}
/**
};
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
<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