[evolution-data-server] Have camel_operation_new() return a GCancellable.



commit 3e1aec7690a705e9fdbb7e89b0c7b9722f18892e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Sep 29 08:06:02 2010 -0400

    Have camel_operation_new() return a GCancellable.
    
    Easier than having to cast the returned pointer everywhere.

 camel/camel-operation.c |    2 +-
 camel/camel-operation.h |    2 +-
 camel/camel-service.c   |    4 ++--
 camel/camel-session.c   |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index f00c92b..67cccda 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -206,7 +206,7 @@ camel_operation_init (CamelOperation *operation)
  *
  * Returns: A new operation handle.
  **/
-CamelOperation *
+GCancellable *
 camel_operation_new (void)
 {
 	return g_object_new (CAMEL_TYPE_OPERATION, NULL);
diff --git a/camel/camel-operation.h b/camel/camel-operation.h
index 7cdec8e..ccbaf36 100644
--- a/camel/camel-operation.h
+++ b/camel/camel-operation.h
@@ -67,7 +67,7 @@ struct _CamelOperationClass {
 GType		camel_operation_get_type	(void);
 
 /* main thread functions */
-CamelOperation *camel_operation_new		(void);
+GCancellable *	camel_operation_new		(void);
 void		camel_operation_cancel		(CamelOperation *operation);
 void		camel_operation_uncancel	(CamelOperation *operation);
 
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 48478df..1ae2a6a 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -442,7 +442,7 @@ camel_service_connect_sync (CamelService *service,
 	/* Register a separate operation for connecting, so that
 	 * the offline code can cancel it. */
 	camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK);
-	service->connect_op = (GCancellable *) camel_operation_new ();
+	service->connect_op = camel_operation_new ();
 	camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK);
 
 	service->status = CAMEL_SERVICE_CONNECTING;
@@ -489,7 +489,7 @@ camel_service_disconnect_sync (CamelService *service,
 	if (service->status != CAMEL_SERVICE_DISCONNECTED
 	    && service->status != CAMEL_SERVICE_DISCONNECTING) {
 		camel_service_lock (service, CAMEL_SERVICE_CONNECT_OP_LOCK);
-		service->connect_op = (GCancellable *) camel_operation_new ();
+		service->connect_op = camel_operation_new ();
 		camel_service_unlock (service, CAMEL_SERVICE_CONNECT_OP_LOCK);
 
 		service->status = CAMEL_SERVICE_DISCONNECTING;
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 9d43d0d..d5b16fb 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -276,7 +276,7 @@ session_thread_msg_new (CamelSession *session,
 	m = g_malloc0 (size);
 	m->ops = ops;
 	m->session = g_object_ref (session);
-	m->cancellable = (GCancellable *) camel_operation_new ();
+	m->cancellable = camel_operation_new ();
 	camel_session_lock (session, CAMEL_SESSION_THREAD_LOCK);
 	m->id = session->priv->thread_id++;
 	g_hash_table_insert (session->priv->thread_active, GINT_TO_POINTER (m->id), m);



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