[evolution-ews] e_ews_connect_new(): Remove GError argument.



commit 610cdec0bebcab558e431c3da30ce2ef18ac7ed0
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Jul 30 16:56:36 2012 -0400

    e_ews_connect_new(): Remove GError argument.
    
    e_ews_connect_new() never fails, so remove the GError argument and all
    the needless error checking where it gets called.

 src/addressbook/e-book-backend-ews.c               |    9 +++------
 src/calendar/e-cal-backend-ews.c                   |    5 +----
 src/camel/camel-ews-store.c                        |    2 +-
 src/collection/e-ews-backend.c                     |    5 +----
 src/configuration/e-ews-config-utils.c             |    3 +--
 .../e-mail-config-ews-oal-combo-box.c              |    3 +--
 src/configuration/e-mail-config-ews-ooo-page.c     |    3 +--
 src/server/e-ews-connection.c                      |   20 ++------------------
 src/server/e-ews-connection.h                      |    3 +--
 src/server/tests/test-autocompletion.c             |    3 +--
 src/server/tests/test-connection.c                 |    3 +--
 src/server/tests/test-createfolder.c               |    3 +--
 src/server/tests/test-cuditem.c                    |    3 +--
 src/server/tests/test-deletefolder.c               |    3 +--
 src/server/tests/test-get-oof-settings.c           |    3 +--
 src/server/tests/test-getattachment.c              |    3 +--
 src/server/tests/test-getdelegate.c                |    3 +--
 src/server/tests/test-set-oof-settings.c           |    3 +--
 src/server/tests/test-syncfolder.c                 |    9 +++------
 src/utils/ews-test-finditem-query.c                |    3 +--
 20 files changed, 25 insertions(+), 67 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-ews.c b/src/addressbook/e-book-backend-ews.c
index 1cecc58..86ec903 100644
--- a/src/addressbook/e-book-backend-ews.c
+++ b/src/addressbook/e-book-backend-ews.c
@@ -1692,7 +1692,7 @@ ews_download_full_gal (EBookBackendEws *cbews,
 	comp_cache_file = g_build_filename (cache_dir, full->filename, NULL);
 
 	oab_cnc = e_ews_connection_new (
-		full_url, priv->password, ews_settings, NULL);
+		full_url, priv->password, ews_settings);
 	if (!e_ews_connection_download_oal_file_sync (
 		oab_cnc, comp_cache_file, NULL, NULL, cancellable, error))
 		goto exit;
@@ -1847,7 +1847,7 @@ ebews_start_gal_sync (gpointer data)
 	priv = cbews->priv;
 
 	oab_cnc = e_ews_connection_new (
-		priv->oab_url, priv->password, ews_settings, NULL);
+		priv->oab_url, priv->password, ews_settings);
 
 	d(printf ("Ewsgal: Fetching oal full details file \n");)
 
@@ -2939,13 +2939,10 @@ book_backend_ews_try_password_sync (ESourceAuthenticator *authenticator,
 	hosturl = camel_ews_settings_dup_hosturl (ews_settings);
 
 	connection = e_ews_connection_new (
-		hosturl, password->str, ews_settings, error);
+		hosturl, password->str, ews_settings);
 
 	g_free (hosturl);
 
-	if (connection == NULL)
-		return E_SOURCE_AUTHENTICATION_ERROR;
-
 	fid = g_new0 (EwsFolderId, 1);
 	fid->id = g_strdup ("contacts");
 	fid->is_distinguished_id = TRUE;
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 5817dfa..f37ac55 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -4071,13 +4071,10 @@ cal_backend_ews_try_password_sync (ESourceAuthenticator *authenticator,
 	hosturl = camel_ews_settings_dup_hosturl (ews_settings);
 
 	connection = e_ews_connection_new (
-		hosturl, password->str, ews_settings, error);
+		hosturl, password->str, ews_settings);
 
 	g_free (hosturl);
 
-	if (connection == NULL)
-		return E_SOURCE_AUTHENTICATION_ERROR;
-
 	store = backend->priv->store;
 	sync_state = e_cal_backend_store_get_key_value (store, SYNC_KEY);
 	sync_state_inout = g_strdup (sync_state);
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index 10d698e..6a10581 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -350,7 +350,7 @@ ews_authenticate_sync (CamelService *service,
 	hosturl = camel_ews_settings_dup_hosturl (ews_settings);
 
 	connection = e_ews_connection_new (
-		hosturl, password, ews_settings, NULL);
+		hosturl, password, ews_settings);
 
 	g_free (hosturl);
 
diff --git a/src/collection/e-ews-backend.c b/src/collection/e-ews-backend.c
index 0e0e3ba..43d8ee0 100644
--- a/src/collection/e-ews-backend.c
+++ b/src/collection/e-ews-backend.c
@@ -606,13 +606,10 @@ ews_backend_try_password_sync (ESourceAuthenticator *authenticator,
 	hosturl = camel_ews_settings_dup_hosturl (ews_settings);
 
 	connection = e_ews_connection_new (
-		hosturl, password->str, ews_settings, error);
+		hosturl, password->str, ews_settings);
 
 	g_free (hosturl);
 
-	if (connection == NULL)
-		return E_SOURCE_AUTHENTICATION_ERROR;
-
 	g_mutex_lock (backend->priv->sync_state_lock);
 	sync_state = g_strdup (backend->priv->sync_state);
 	g_mutex_unlock (backend->priv->sync_state_lock);
diff --git a/src/configuration/e-ews-config-utils.c b/src/configuration/e-ews-config-utils.c
index 3319ff4..982dac8 100644
--- a/src/configuration/e-ews-config-utils.c
+++ b/src/configuration/e-ews-config-utils.c
@@ -275,8 +275,7 @@ ews_config_utils_authenticator_try_password_sync (ESourceAuthenticator *auth,
 	user = camel_network_settings_dup_user (network_settings);
 
 	authenticator->conn = e_ews_connection_new (
-		hosturl, password->str, authenticator->ews_settings,
-		&local_error);
+		hosturl, password->str, authenticator->ews_settings);
 
 	g_free (hosturl);
 	g_free (user);
diff --git a/src/configuration/e-mail-config-ews-oal-combo-box.c b/src/configuration/e-mail-config-ews-oal-combo-box.c
index d10c934..9e2e298 100644
--- a/src/configuration/e-mail-config-ews-oal-combo-box.c
+++ b/src/configuration/e-mail-config-ews-oal-combo-box.c
@@ -154,9 +154,8 @@ mail_config_ews_oal_combo_box_try_password_sync (ESourceAuthenticator *auth,
 	ews_settings = CAMEL_EWS_SETTINGS (settings);
 	oab_url = camel_ews_settings_get_oaburl (ews_settings);
 
-	/* XXX This takes a GError but never fails, so skip it. */
 	cnc = e_ews_connection_new (
-		oab_url, password->str, ews_settings, NULL);
+		oab_url, password->str, ews_settings);
 
 	e_ews_connection_get_oal_list_sync (
 		cnc, &oal_items, cancellable, &local_error);
diff --git a/src/configuration/e-mail-config-ews-ooo-page.c b/src/configuration/e-mail-config-ews-ooo-page.c
index 4ccde5a..4ab1036 100644
--- a/src/configuration/e-mail-config-ews-ooo-page.c
+++ b/src/configuration/e-mail-config-ews-ooo-page.c
@@ -796,9 +796,8 @@ mail_config_ews_ooo_page_try_password_sync (ESourceAuthenticator *auth,
 	ews_settings = CAMEL_EWS_SETTINGS (settings);
 	hosturl = camel_ews_settings_get_hosturl (ews_settings);
 
-	/* XXX This takes a GError but never fails, so skip it. */
 	connection = e_ews_connection_new (
-		hosturl, password->str, ews_settings, NULL);
+		hosturl, password->str, ews_settings);
 
 	e_ews_connection_set_mailbox (connection, mailbox);
 
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index fc9dc4a..b52404c 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -1541,7 +1541,6 @@ e_ews_connection_find (const gchar *uri,
  * @uri: Exchange server uri
  * @password:
  * @settings: a #CamelEwsSettings
- * @error: Currently unused, but may require in future. Can take NULL value.
  *
  * This does not authenticate to the server. It merely stores the username and password.
  * Authentication happens when a request is made to the server.
@@ -1551,8 +1550,7 @@ e_ews_connection_find (const gchar *uri,
 EEwsConnection *
 e_ews_connection_new (const gchar *uri,
                       const gchar *password,
-                      CamelEwsSettings *settings,
-                      GError **error)
+                      CamelEwsSettings *settings)
 {
 	CamelNetworkSettings *network_settings;
 	EEwsConnection *cnc;
@@ -1980,7 +1978,6 @@ e_ews_autodiscover_ws_url (CamelEwsSettings *settings,
 	gboolean use_secure = TRUE;
 	const gchar *host_url;
 	const gchar *user;
-	GError *error = NULL;
 
 	g_return_if_fail (CAMEL_IS_EWS_SETTINGS (settings));
 	g_return_if_fail (email_address != NULL);
@@ -2035,20 +2032,7 @@ e_ews_autodiscover_ws_url (CamelEwsSettings *settings,
 	if (user == NULL || *user == '\0')
 		user = email_address;
 
-	cnc = e_ews_connection_new (url3, password, settings, &error);
-	if (cnc == NULL) {
-		g_free (url1);
-		g_free (url2);
-		g_free (url3);
-		g_free (url4);
-		xmlOutputBufferClose (buf);
-		xmlFreeDoc (doc);
-
-		g_simple_async_result_take_error (simple, error);
-		g_simple_async_result_complete_in_idle (simple);
-		g_object_unref (simple);
-		return;
-	}
+	cnc = e_ews_connection_new (url3, password, settings);
 
 	/*
 	 * http://msdn.microsoft.com/en-us/library/ee332364.aspx says we are
diff --git a/src/server/e-ews-connection.h b/src/server/e-ews-connection.h
index fe73394..0f26fd5 100644
--- a/src/server/e-ews-connection.h
+++ b/src/server/e-ews-connection.h
@@ -180,8 +180,7 @@ void		ews_oal_details_free		(EwsOALDetails *details);
 GType		e_ews_connection_get_type	(void);
 EEwsConnection *e_ews_connection_new		(const gchar *uri,
 						 const gchar *password,
-						 CamelEwsSettings *settings,
-						 GError **error);
+						 CamelEwsSettings *settings);
 const gchar *	e_ews_connection_get_uri	(EEwsConnection *cnc);
 CamelEwsSettings *
 		e_ews_connection_ref_settings	(EEwsConnection *cnc);
diff --git a/src/server/tests/test-autocompletion.c b/src/server/tests/test-autocompletion.c
index 7190812..075fa6e 100644
--- a/src/server/tests/test-autocompletion.c
+++ b/src/server/tests/test-autocompletion.c
@@ -93,8 +93,7 @@ op_test_resolve_names ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-connection.c b/src/server/tests/test-connection.c
index 23741fd..0703adf 100644
--- a/src/server/tests/test-connection.c
+++ b/src/server/tests/test-connection.c
@@ -59,8 +59,7 @@ con_test_create_new_connection ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-createfolder.c b/src/server/tests/test-createfolder.c
index c8e0cbd..8fe4253 100644
--- a/src/server/tests/test-createfolder.c
+++ b/src/server/tests/test-createfolder.c
@@ -90,8 +90,7 @@ op_test_create_folder ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-cuditem.c b/src/server/tests/test-cuditem.c
index fd491a9..fd5e137 100644
--- a/src/server/tests/test-cuditem.c
+++ b/src/server/tests/test-cuditem.c
@@ -113,8 +113,7 @@ op_test_create_item ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-deletefolder.c b/src/server/tests/test-deletefolder.c
index 73afbb7..2ec4bae 100644
--- a/src/server/tests/test-deletefolder.c
+++ b/src/server/tests/test-deletefolder.c
@@ -81,8 +81,7 @@ op_test_delete_folder (gpointer data)
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-get-oof-settings.c b/src/server/tests/test-get-oof-settings.c
index 65f60d6..08c6bb8 100644
--- a/src/server/tests/test-get-oof-settings.c
+++ b/src/server/tests/test-get-oof-settings.c
@@ -82,8 +82,7 @@ op_test_get_oof_settings ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"username", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-getattachment.c b/src/server/tests/test-getattachment.c
index 8b17a85..200c511 100644
--- a/src/server/tests/test-getattachment.c
+++ b/src/server/tests/test-getattachment.c
@@ -87,8 +87,7 @@ op_test_get_attachments ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-getdelegate.c b/src/server/tests/test-getdelegate.c
index 980e61a..7080186 100644
--- a/src/server/tests/test-getdelegate.c
+++ b/src/server/tests/test-getdelegate.c
@@ -89,8 +89,7 @@ op_test_get_delegate ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-set-oof-settings.c b/src/server/tests/test-set-oof-settings.c
index a09f1e1..e46417c 100644
--- a/src/server/tests/test-set-oof-settings.c
+++ b/src/server/tests/test-set-oof-settings.c
@@ -97,8 +97,7 @@ op_test_set_oof_settings ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/server/tests/test-syncfolder.c b/src/server/tests/test-syncfolder.c
index db6454e..768dabe 100644
--- a/src/server/tests/test-syncfolder.c
+++ b/src/server/tests/test-syncfolder.c
@@ -105,8 +105,7 @@ op_test_sync_folder_items ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
@@ -185,8 +184,7 @@ op_test_sync_folder_hierarchy ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
@@ -253,8 +251,7 @@ op_test_get_item ()
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 
diff --git a/src/utils/ews-test-finditem-query.c b/src/utils/ews-test-finditem-query.c
index dd2655c..3bfc5b4 100644
--- a/src/utils/ews-test-finditem-query.c
+++ b/src/utils/ews-test-finditem-query.c
@@ -117,8 +117,7 @@ op_test_finditem_run (void)
 		CAMEL_TYPE_EWS_SETTINGS,
 		"user", username, NULL);
 
-	cnc = e_ews_connection_new (uri, password, settings, NULL);
-	g_assert (cnc != NULL);
+	cnc = e_ews_connection_new (uri, password, settings);
 
 	g_object_unref (settings);
 



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