|
|
5e6360 |
diff -up evolution-data-server-3.12.11/addressbook/backends/webdav/e-book-backend-webdav.c.implement-webdav-refresh evolution-data-server-3.12.11/addressbook/backends/webdav/e-book-backend-webdav.c
|
|
|
5e6360 |
--- evolution-data-server-3.12.11/addressbook/backends/webdav/e-book-backend-webdav.c.implement-webdav-refresh 2014-05-22 08:45:46.000000000 +0200
|
|
|
5e6360 |
+++ evolution-data-server-3.12.11/addressbook/backends/webdav/e-book-backend-webdav.c 2015-05-04 19:15:14.463350678 +0200
|
|
|
5e6360 |
@@ -832,6 +832,7 @@ static gboolean
|
|
|
5e6360 |
download_contacts (EBookBackendWebdav *webdav,
|
|
|
5e6360 |
EFlag *running,
|
|
|
5e6360 |
EDataBookView *book_view,
|
|
|
5e6360 |
+ gboolean force,
|
|
|
5e6360 |
GCancellable *cancellable,
|
|
|
5e6360 |
GError **error)
|
|
|
5e6360 |
{
|
|
|
5e6360 |
@@ -851,7 +852,7 @@ download_contacts (EBookBackendWebdav *w
|
|
|
5e6360 |
|
|
|
5e6360 |
g_mutex_lock (&priv->update_lock);
|
|
|
5e6360 |
|
|
|
5e6360 |
- if (!check_addressbook_changed (webdav, &new_ctag, cancellable)) {
|
|
|
5e6360 |
+ if (!force && !check_addressbook_changed (webdav, &new_ctag, cancellable)) {
|
|
|
5e6360 |
g_free (new_ctag);
|
|
|
5e6360 |
g_mutex_unlock (&priv->update_lock);
|
|
|
5e6360 |
return TRUE;
|
|
|
5e6360 |
@@ -1072,7 +1073,7 @@ book_view_thread (gpointer data)
|
|
|
5e6360 |
* it's stopped */
|
|
|
5e6360 |
g_object_ref (book_view);
|
|
|
5e6360 |
|
|
|
5e6360 |
- download_contacts (webdav, closure->running, book_view, NULL, NULL);
|
|
|
5e6360 |
+ download_contacts (webdav, closure->running, book_view, FALSE, NULL, NULL);
|
|
|
5e6360 |
|
|
|
5e6360 |
g_object_unref (book_view);
|
|
|
5e6360 |
|
|
|
5e6360 |
@@ -1218,7 +1219,7 @@ book_backend_webdav_get_backend_property
|
|
|
5e6360 |
g_return_val_if_fail (prop_name != NULL, NULL);
|
|
|
5e6360 |
|
|
|
5e6360 |
if (g_str_equal (prop_name, CLIENT_BACKEND_PROPERTY_CAPABILITIES)) {
|
|
|
5e6360 |
- return g_strdup ("net,do-initial-query,contact-lists");
|
|
|
5e6360 |
+ return g_strdup ("net,do-initial-query,contact-lists,refresh-supported");
|
|
|
5e6360 |
|
|
|
5e6360 |
} else if (g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_REQUIRED_FIELDS)) {
|
|
|
5e6360 |
return g_strdup (e_contact_field_name (E_CONTACT_FILE_AS));
|
|
|
5e6360 |
@@ -1764,7 +1765,7 @@ book_backend_webdav_get_contact_list_syn
|
|
|
5e6360 |
|
|
|
5e6360 |
if (e_backend_get_online (E_BACKEND (backend))) {
|
|
|
5e6360 |
/* make sure the cache is up to date */
|
|
|
5e6360 |
- if (!download_contacts (webdav, NULL, NULL, cancellable, error))
|
|
|
5e6360 |
+ if (!download_contacts (webdav, NULL, NULL, FALSE, cancellable, error))
|
|
|
5e6360 |
return FALSE;
|
|
|
5e6360 |
}
|
|
|
5e6360 |
|
|
|
5e6360 |
@@ -1822,6 +1823,29 @@ book_backend_webdav_try_password_sync (E
|
|
|
5e6360 |
return result;
|
|
|
5e6360 |
}
|
|
|
5e6360 |
|
|
|
5e6360 |
+static gboolean
|
|
|
5e6360 |
+e_book_backend_webdav_refresh_sync (EBookBackend *book_backend,
|
|
|
5e6360 |
+ GCancellable *cancellable,
|
|
|
5e6360 |
+ GError **error)
|
|
|
5e6360 |
+{
|
|
|
5e6360 |
+ EBackend *backend;
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ g_return_val_if_fail (E_IS_BOOK_BACKEND_WEBDAV (book_backend), FALSE);
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ backend = E_BACKEND (book_backend);
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ if (!e_backend_get_online (backend) &&
|
|
|
5e6360 |
+ e_backend_is_destination_reachable (backend, cancellable, NULL)) {
|
|
|
5e6360 |
+ e_backend_set_online (backend, TRUE);
|
|
|
5e6360 |
+ }
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ if (e_backend_get_online (backend) && !g_cancellable_is_cancelled (cancellable)) {
|
|
|
5e6360 |
+ return download_contacts (E_BOOK_BACKEND_WEBDAV (book_backend), NULL, NULL, TRUE, cancellable, error);
|
|
|
5e6360 |
+ }
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ return TRUE;
|
|
|
5e6360 |
+}
|
|
|
5e6360 |
+
|
|
|
5e6360 |
static void
|
|
|
5e6360 |
e_book_backend_webdav_class_init (EBookBackendWebdavClass *class)
|
|
|
5e6360 |
{
|
|
|
5e6360 |
@@ -1844,6 +1868,7 @@ e_book_backend_webdav_class_init (EBookB
|
|
|
5e6360 |
backend_class->get_contact_list_sync = book_backend_webdav_get_contact_list_sync;
|
|
|
5e6360 |
backend_class->start_view = e_book_backend_webdav_start_view;
|
|
|
5e6360 |
backend_class->stop_view = e_book_backend_webdav_stop_view;
|
|
|
5e6360 |
+ backend_class->refresh_sync = e_book_backend_webdav_refresh_sync;
|
|
|
5e6360 |
}
|
|
|
5e6360 |
|
|
|
5e6360 |
static void
|
|
|
5e6360 |
diff -up evolution-data-server-3.12.11/calendar/backends/caldav/e-cal-backend-caldav.c.implement-webdav-refresh evolution-data-server-3.12.11/calendar/backends/caldav/e-cal-backend-caldav.c
|
|
|
5e6360 |
--- evolution-data-server-3.12.11/calendar/backends/caldav/e-cal-backend-caldav.c.implement-webdav-refresh 2014-11-12 17:57:45.000000000 +0100
|
|
|
5e6360 |
+++ evolution-data-server-3.12.11/calendar/backends/caldav/e-cal-backend-caldav.c 2015-05-04 19:15:14.464350669 +0200
|
|
|
5e6360 |
@@ -3013,9 +3013,17 @@ caldav_refresh (ECalBackendSync *backend
|
|
|
5e6360 |
g_mutex_lock (&cbdav->priv->busy_lock);
|
|
|
5e6360 |
|
|
|
5e6360 |
if (!cbdav->priv->loaded
|
|
|
5e6360 |
- || cbdav->priv->slave_cmd == SLAVE_SHOULD_DIE
|
|
|
5e6360 |
- || !check_state (cbdav, &online, NULL)
|
|
|
5e6360 |
- || !online) {
|
|
|
5e6360 |
+ || cbdav->priv->slave_cmd == SLAVE_SHOULD_DIE) {
|
|
|
5e6360 |
+ g_mutex_unlock (&cbdav->priv->busy_lock);
|
|
|
5e6360 |
+ return;
|
|
|
5e6360 |
+ }
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ if (!e_backend_get_online (E_BACKEND (backend)) &&
|
|
|
5e6360 |
+ e_backend_is_destination_reachable (E_BACKEND (backend), cancellable, NULL)) {
|
|
|
5e6360 |
+ e_backend_set_online (E_BACKEND (backend), TRUE);
|
|
|
5e6360 |
+ }
|
|
|
5e6360 |
+
|
|
|
5e6360 |
+ if (!check_state (cbdav, &online, NULL) || !online) {
|
|
|
5e6360 |
g_mutex_unlock (&cbdav->priv->busy_lock);
|
|
|
5e6360 |
return;
|
|
|
5e6360 |
}
|