[evolution-mapi] Fix a build break caused by EBook/CalBackend API deprecation



commit 25cb03caa2a38c55e17489a91056cff149b6cece
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jan 31 09:00:33 2013 +0100

    Fix a build break caused by EBook/CalBackend API deprecation

 src/addressbook/e-book-backend-mapi-contacts.c |    2 +-
 src/addressbook/e-book-backend-mapi.c          |   21 ++++++------------
 src/calendar/e-cal-backend-mapi.c              |   27 ++++++++----------------
 3 files changed, 17 insertions(+), 33 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-mapi-contacts.c b/src/addressbook/e-book-backend-mapi-contacts.c
index 2a31ac0..b2012f4 100644
--- a/src/addressbook/e-book-backend-mapi-contacts.c
+++ b/src/addressbook/e-book-backend-mapi-contacts.c
@@ -348,7 +348,7 @@ ebbm_contacts_connection_status_changed (EBookBackendMAPI *ebma, gboolean is_onl
 	ESource *source;
 	ESourceMapiFolder *ext_mapi_folder;
 
-	e_book_backend_notify_readonly (E_BOOK_BACKEND (ebma), !is_online);
+	e_book_backend_set_writable (E_BOOK_BACKEND (ebma), is_online);
 
 	if (!is_online)
 		return;
diff --git a/src/addressbook/e-book-backend-mapi.c b/src/addressbook/e-book-backend-mapi.c
index 5ecac20..45a8d5f 100644
--- a/src/addressbook/e-book-backend-mapi.c
+++ b/src/addressbook/e-book-backend-mapi.c
@@ -489,10 +489,8 @@ ebbm_open (EBookBackendMAPI *ebma,
 	const gchar *cache_dir;
 	GError *error = NULL;
 
-	if (e_book_backend_is_opened (E_BOOK_BACKEND (ebma))) {
-		e_book_backend_notify_opened (E_BOOK_BACKEND (ebma), NULL /* Success */);
+	if (e_book_backend_is_opened (E_BOOK_BACKEND (ebma)))
 		return;
-	}
 
 	offline_extension = e_source_get_extension (source, E_SOURCE_EXTENSION_OFFLINE);
 	priv->marked_for_offline = e_source_offline_get_stay_synchronized (offline_extension);
@@ -516,7 +514,7 @@ ebbm_open (EBookBackendMAPI *ebma,
 		return;
 	}
 
-	e_book_backend_notify_readonly (E_BOOK_BACKEND (ebma), TRUE);
+	e_book_backend_set_writable (E_BOOK_BACKEND (ebma), FALSE);
 
 	ebbm_notify_connection_status (ebma, e_backend_get_online (E_BACKEND (ebma)));
 
@@ -524,25 +522,20 @@ ebbm_open (EBookBackendMAPI *ebma,
 	if (!e_backend_get_online (E_BACKEND (ebma)) &&
 	    !priv->marked_for_offline) {
 		g_propagate_error (perror, EDB_ERROR (OFFLINE_UNAVAILABLE));
-		e_book_backend_notify_opened (E_BOOK_BACKEND (ebma), EDB_ERROR (OFFLINE_UNAVAILABLE));
 		return;
 	}
 
 	/* Once aunthentication in address book works this can be removed */
 	if (!e_backend_get_online (E_BACKEND (ebma))) {
-		e_book_backend_notify_online (E_BOOK_BACKEND (ebma), FALSE);
-		e_book_backend_notify_opened (E_BOOK_BACKEND (ebma), NULL /* Success */);
+		e_backend_set_online (E_BACKEND (ebma), FALSE);
 		return;
 	}
 
-	e_book_backend_notify_online (E_BOOK_BACKEND (ebma), TRUE);
+	e_backend_set_online (E_BACKEND (ebma), TRUE);
 
 	e_book_backend_mapi_ensure_connected (ebma, cancellable, &error);
 
-	if (error && perror)
-		g_propagate_error (perror, g_error_copy (error));
-
-	e_book_backend_notify_opened (E_BOOK_BACKEND (ebma), error);
+	g_propagate_error (perror, error);
 }
 
 static ESourceAuthenticationResult
@@ -632,7 +625,7 @@ ebbm_notify_online_cb (EBookBackend *backend, GParamSpec *pspec)
 		e_book_backend_mapi_lock_connection (ebma);
 
 		if (!online) {
-			e_book_backend_notify_readonly (backend, TRUE);
+			e_book_backend_set_writable (backend, FALSE);
 			ebbm_notify_connection_status (ebma, FALSE);
 
 			if (priv->conn) {
@@ -646,7 +639,7 @@ ebbm_notify_online_cb (EBookBackend *backend, GParamSpec *pspec)
 		e_book_backend_mapi_unlock_connection (ebma);
 	}
 
-	e_book_backend_notify_online (backend, online);
+	e_backend_set_online (E_BACKEND (backend), online);
 }
 
 static void
diff --git a/src/calendar/e-cal-backend-mapi.c b/src/calendar/e-cal-backend-mapi.c
index c8332af..04af1f3 100644
--- a/src/calendar/e-cal-backend-mapi.c
+++ b/src/calendar/e-cal-backend-mapi.c
@@ -1235,7 +1235,7 @@ ecbm_connect_user (ECalBackend *backend,
 
 	/* We have established a connection */
 	if (priv->store && priv->fid) {
-		e_cal_backend_notify_online (E_CAL_BACKEND (cbmapi), TRUE);
+		e_backend_set_online (E_BACKEND (cbmapi), TRUE);
 
 		if (priv->mode_changed && !priv->dthread) {
 			priv->mode_changed = FALSE;
@@ -1334,10 +1334,8 @@ ecbm_open (ECalBackend *backend,
 	const gchar *cache_dir;
 	GError *error = NULL;
 
-	if (e_cal_backend_is_opened (backend)) {
-		e_cal_backend_notify_opened (backend, NULL);
+	if (e_cal_backend_is_opened (backend))
 		return /* Success */;
-	}
 
 	cbmapi = E_CAL_BACKEND_MAPI (backend);
 	priv = cbmapi->priv;
@@ -1347,7 +1345,6 @@ ecbm_open (ECalBackend *backend,
 	fid = e_source_mapi_folder_get_id (ext_mapi_folder);
 	if (!fid) {
 		g_propagate_error (perror, EDC_ERROR_EX (OtherError, "No folder ID set"));
-		e_cal_backend_notify_opened (backend, EDC_ERROR_EX (OtherError, "No folder ID set"));
 		return;
 	}
 
@@ -1367,7 +1364,6 @@ ecbm_open (ECalBackend *backend,
 	if (!priv->store) {
 		g_mutex_unlock (&priv->mutex);
 		g_propagate_error (perror, EDC_ERROR_EX (OtherError, _("Could not create cache file")));
-		e_cal_backend_notify_opened (backend, EDC_ERROR_EX (OtherError, _("Could not create cache file")));
 		return;
 	}
 
@@ -1384,14 +1380,12 @@ ecbm_open (ECalBackend *backend,
 		if (!e_source_offline_get_stay_synchronized (offline_extension)) {
 			g_mutex_unlock (&priv->mutex);
 			g_propagate_error (perror, EDC_ERROR (RepositoryOffline));
-			e_cal_backend_notify_opened (backend, EDC_ERROR (RepositoryOffline));
 			return;
 		}
 
 		g_mutex_unlock (&priv->mutex);
-		e_cal_backend_notify_online (backend, FALSE);
-		e_cal_backend_notify_readonly (backend, priv->read_only);
-		e_cal_backend_notify_opened (backend, NULL);
+		e_backend_set_online (E_BACKEND (backend), FALSE);
+		e_cal_backend_set_writable (backend, !priv->read_only);
 		return /* Success */;
 	}
 
@@ -1408,15 +1402,12 @@ ecbm_open (ECalBackend *backend,
 
 	g_mutex_unlock (&priv->mutex);
 
-	e_cal_backend_notify_online (backend, TRUE);
-	e_cal_backend_notify_readonly (backend, priv->read_only);
+	e_backend_set_online (E_BACKEND (backend), TRUE);
+	e_cal_backend_set_writable (backend, !priv->read_only);
 
 	e_cal_backend_mapi_ensure_connected (cbmapi, cancellable, &error);
 
-	if (error && perror)
-		g_propagate_error (perror, g_error_copy (error));
-
-	e_cal_backend_notify_opened (backend, error);
+	g_propagate_error (perror, error);
 }
 
 
@@ -2561,8 +2552,8 @@ ecbm_notify_online_cb (ECalBackend *backend, GParamSpec *pspec)
 		priv->conn = NULL;
 	}
 
-	e_cal_backend_notify_readonly (backend, priv->read_only);
-	e_cal_backend_notify_online (backend, online);
+	e_cal_backend_set_writable (backend, !priv->read_only);
+	e_backend_set_online (E_BACKEND (backend), online);
 	g_mutex_unlock (&priv->mutex);
 }
 



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