[evolution-data-server] Remove camel_operation_cancel_prfd().



commit 156b9d7e167282bdb44b7d2842860616d4793dcf
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Nov 4 18:49:11 2011 -0400

    Remove camel_operation_cancel_prfd().
    
    No longer needed by anything.  Also allowed me to remove all the
    CamelMsgPort muck in CamelOperation, which simplifies things nicely.

 camel/camel-operation.c                        |   83 ------------------------
 camel/camel-operation.h                        |    2 -
 docs/reference/camel/camel-sections.txt        |    1 -
 docs/reference/camel/tmpl/camel-operation.sgml |    9 ---
 docs/reference/camel/tmpl/camel-unused.sgml    |    8 ++
 5 files changed, 8 insertions(+), 95 deletions(-)
---
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 87d8dc8..129a7aa 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -44,11 +44,7 @@ struct _StatusNode {
 };
 
 struct _CamelOperationPrivate {
-
 	GQueue status_stack;
-
-	CamelMsgPort *cancel_port;
-	PRFileDesc *cancel_prfd;
 };
 
 enum {
@@ -136,41 +132,6 @@ operation_emit_status_cb (StatusNode *node)
 }
 
 static void
-operation_flush_msgport (CamelOperation *operation)
-{
-	CamelOperationPrivate *priv = operation->priv;
-	CamelMsg *msg;
-
-	LOCK ();
-
-	while ((msg = camel_msgport_try_pop (priv->cancel_port)) != NULL)
-		g_free (msg);
-
-	UNLOCK ();
-}
-
-static void
-operation_cancelled (GCancellable *cancellable)
-{
-	CamelOperation *operation;
-	CamelMsg *msg;
-
-	g_return_if_fail (cancellable != NULL);
-	g_return_if_fail (CAMEL_IS_OPERATION (cancellable));
-
-	operation = CAMEL_OPERATION (cancellable);
-	g_return_if_fail (operation != NULL);
-	g_return_if_fail (operation->priv != NULL);
-
-	LOCK ();
-
-	msg = g_malloc0 (sizeof (CamelMsg));
-	camel_msgport_push (operation->priv->cancel_port, msg);
-
-	UNLOCK ();
-}
-
-static void
 operation_finalize (GObject *object)
 {
 	CamelOperationPrivate *priv;
@@ -181,9 +142,6 @@ operation_finalize (GObject *object)
 
 	g_queue_remove (&operation_list, object);
 
-	operation_flush_msgport (CAMEL_OPERATION (object));
-	camel_msgport_destroy (priv->cancel_port);
-
 	/* Because each StatusNode holds a reference to its
 	 * CamelOperation, the fact that we're being finalized
 	 * implies the stack should be empty now. */
@@ -199,16 +157,12 @@ static void
 camel_operation_class_init (CamelOperationClass *class)
 {
 	GObjectClass *object_class;
-	GCancellableClass *cancellable_class;
 
 	g_type_class_add_private (class, sizeof (CamelOperationPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
 	object_class->finalize = operation_finalize;
 
-	cancellable_class = G_CANCELLABLE_CLASS (class);
-	cancellable_class->cancelled = operation_cancelled;
-
 	signals[STATUS] = g_signal_new (
 		"status",
 		G_TYPE_FROM_CLASS (class),
@@ -228,7 +182,6 @@ camel_operation_init (CamelOperation *operation)
 		operation, CAMEL_TYPE_OPERATION, CamelOperationPrivate);
 
 	g_queue_init (&operation->priv->status_stack);
-	operation->priv->cancel_port = camel_msgport_new ();
 
 	LOCK ();
 	g_queue_push_tail (&operation_list, operation);
@@ -301,7 +254,6 @@ camel_operation_uncancel (CamelOperation *operation)
 {
 	if (operation != NULL) {
 		g_return_if_fail (CAMEL_IS_OPERATION (operation));
-		operation_flush_msgport (operation);
 		g_cancellable_reset (G_CANCELLABLE (operation));
 	}
 }
@@ -326,9 +278,6 @@ camel_operation_cancel_check (CamelOperation *operation)
 
 	cancelled = g_cancellable_is_cancelled (G_CANCELLABLE (operation));
 
-	if (cancelled)
-		operation_flush_msgport (operation);
-
 	UNLOCK ();
 
 	return cancelled;
@@ -354,38 +303,6 @@ camel_operation_cancel_fd (CamelOperation *operation)
 }
 
 /**
- * camel_operation_cancel_prfd:
- * @operation: a #CamelOperation
- *
- * Retrieve a file descriptor that can be waited on (select, or poll)
- * for read, to asynchronously detect cancellation.
- *
- * Returns: The fd, or %NULL if cancellation has not been registered
- * for this thread.
- **/
-PRFileDesc *
-camel_operation_cancel_prfd (CamelOperation *operation)
-{
-	CamelOperationPrivate *priv;
-
-	if (operation == NULL)
-		return NULL;
-
-	g_return_val_if_fail (CAMEL_IS_OPERATION (operation), NULL);
-
-	LOCK ();
-
-	priv = operation->priv;
-
-	if (priv->cancel_prfd == NULL)
-		priv->cancel_prfd = camel_msgport_prfd (priv->cancel_port);
-
-	UNLOCK ();
-
-	return priv->cancel_prfd;
-}
-
-/**
  * camel_operation_push_message:
  * @cancellable: a #GCancellable or %NULL
  * @format: a standard printf() format string
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
index f08e21e..f133da6 100644
--- a/camel/camel-operation.h
+++ b/camel/camel-operation.h
@@ -74,8 +74,6 @@ void		camel_operation_uncancel	(CamelOperation *operation);
 /* called internally by camel, for the current thread */
 gboolean	camel_operation_cancel_check	(CamelOperation *operation);
 gint		camel_operation_cancel_fd	(CamelOperation *operation);
-struct PRFileDesc *
-		camel_operation_cancel_prfd	(CamelOperation *operation);
 
 /* Since Camel methods pass around GCancellable pointers instead of
  * CamelOperation pointers, it's more convenient to callers to take
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index ebb2f8d..aaeef68 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -1736,7 +1736,6 @@ camel_operation_cancel
 camel_operation_uncancel
 camel_operation_cancel_check
 camel_operation_cancel_fd
-camel_operation_cancel_prfd
 camel_operation_push_message
 camel_operation_pop_message
 camel_operation_progress
diff --git a/docs/reference/camel/tmpl/camel-operation.sgml b/docs/reference/camel/tmpl/camel-operation.sgml
index 1555b1b..3d19a8c 100644
--- a/docs/reference/camel/tmpl/camel-operation.sgml
+++ b/docs/reference/camel/tmpl/camel-operation.sgml
@@ -71,15 +71,6 @@ camel-operation
 @Returns: 
 
 
-<!-- ##### FUNCTION camel_operation_cancel_prfd ##### -->
-<para>
-
-</para>
-
- operation: 
- Returns: 
-
-
 <!-- ##### FUNCTION camel_operation_push_message ##### -->
 <para>
 
diff --git a/docs/reference/camel/tmpl/camel-unused.sgml b/docs/reference/camel/tmpl/camel-unused.sgml
index a7099f6..c663652 100644
--- a/docs/reference/camel/tmpl/camel-unused.sgml
+++ b/docs/reference/camel/tmpl/camel-unused.sgml
@@ -8375,6 +8375,14 @@ streams
 
 @cc: 
 
+<!-- ##### FUNCTION camel_operation_cancel_prfd ##### -->
+<para>
+
+</para>
+
+ operation: 
+ Returns: 
+
 <!-- ##### FUNCTION camel_operation_cancel_unblock ##### -->
 <para>
 



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