[evolution-data-server] Bug #656267 - Checking for auth types doesn't work properly



commit f4bb87e54fb7d6b202ef775976a1c51d97d366ae
Author: Milan Crha <mcrha redhat com>
Date:   Fri Aug 12 11:29:27 2011 +0200

    Bug #656267 - Checking for auth types doesn't work properly

 camel/camel-session.c |   31 +++++++++++++++++++++++++++++++
 camel/camel-session.h |    2 ++
 2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/camel/camel-session.c b/camel/camel-session.c
index 362c5f4..893fa12 100644
--- a/camel/camel-session.c
+++ b/camel/camel-session.c
@@ -577,6 +577,37 @@ camel_session_add_service (CamelSession *session,
 }
 
 /**
+ * camel_session_remove_service:
+ * @session: a #CamelSession
+ * @uid: a unique identifier for #CamelService to remove
+ *
+ * Removes previously added #CamelService by camel_session_add_service().
+ * Internally stored #CamelService is unreffed, if found.
+ *
+ * Returns: %TRUE when service with given @uid was found and removed,
+ *    %FALSE otherwise.
+ *
+ * Since: 3.2
+ **/
+gboolean
+camel_session_remove_service (CamelSession *session, const gchar *uid)
+{
+	gboolean removed;
+
+	g_return_val_if_fail (session, FALSE);
+	g_return_val_if_fail (CAMEL_IS_SESSION (session), FALSE);
+	g_return_val_if_fail (uid != NULL, FALSE);
+
+	camel_session_lock (session, CAMEL_SESSION_SESSION_LOCK);
+
+	removed = g_hash_table_remove (session->priv->services, uid);
+
+	camel_session_unlock (session, CAMEL_SESSION_SESSION_LOCK);
+
+	return removed;
+}
+
+/**
  * camel_session_get_service:
  * @session: a #CamelSession
  * @uid: a unique identifier string
diff --git a/camel/camel-session.h b/camel/camel-session.h
index 8e01fc8..89b99fd 100644
--- a/camel/camel-session.h
+++ b/camel/camel-session.h
@@ -157,6 +157,8 @@ CamelService *	camel_session_add_service	(CamelSession *session,
 						 const gchar *uri_string,
 						 CamelProviderType type,
 						 GError **error);
+gboolean	camel_session_remove_service	(CamelSession *session,
+						 const gchar *uid);
 CamelService *	camel_session_get_service	(CamelSession *session,
 						 const gchar *uid);
 CamelService *	camel_session_get_service_by_url



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