[evolution-data-server/wip/mcrha/libical-glib] Remove unused parameter in open() function in book and calendar backends



commit c318ba45e9a71debfae27a269c48ae48f13d0906
Author: Milan Crha <mcrha redhat com>
Date:   Thu Apr 11 14:26:53 2019 +0200

    Remove unused parameter in open() function in book and calendar backends
    
    The 'only_if_exists' bool parameter had not been passed from the client
    client side to the backend side, which made it unused on both sides.
    Removed it, together with other API changes in the libedata-book and
    libedata-cal.

 src/addressbook/backends/ldap/e-book-backend-ldap.c     |  3 +--
 src/addressbook/libedata-book/e-book-backend-sync.c     |  3 +--
 src/addressbook/libedata-book/e-book-backend.c          |  2 +-
 src/addressbook/libedata-book/e-book-backend.h          |  3 +--
 src/calendar/backends/contacts/e-cal-backend-contacts.c |  1 -
 src/calendar/backends/file/e-cal-backend-file.c         |  6 +-----
 src/calendar/backends/weather/e-cal-backend-weather.c   |  1 -
 src/calendar/libedata-cal/e-cal-backend-sync.c          | 10 +++-------
 src/calendar/libedata-cal/e-cal-backend-sync.h          |  2 --
 src/calendar/libedata-cal/e-cal-backend.c               |  2 +-
 src/calendar/libedata-cal/e-cal-backend.h               |  3 +--
 src/calendar/libedata-cal/e-cal-meta-backend.c          |  1 -
 src/libedataserver/e-client.c                           | 16 +++-------------
 13 files changed, 13 insertions(+), 40 deletions(-)
---
diff --git a/src/addressbook/backends/ldap/e-book-backend-ldap.c 
b/src/addressbook/backends/ldap/e-book-backend-ldap.c
index 624736e43..1efbd1cb3 100644
--- a/src/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/src/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -4927,8 +4927,7 @@ static void
 book_backend_ldap_open (EBookBackend *backend,
                         EDataBook *book,
                         guint opid,
-                        GCancellable *cancellable,
-                        gboolean only_if_exists)
+                        GCancellable *cancellable)
 {
        EBookBackendLDAP *bl = E_BOOK_BACKEND_LDAP (backend);
        ESourceAuthentication *auth_extension;
diff --git a/src/addressbook/libedata-book/e-book-backend-sync.c 
b/src/addressbook/libedata-book/e-book-backend-sync.c
index 21f293b2e..852ebaea1 100644
--- a/src/addressbook/libedata-book/e-book-backend-sync.c
+++ b/src/addressbook/libedata-book/e-book-backend-sync.c
@@ -48,8 +48,7 @@ static void
 book_backend_sync_open (EBookBackend *backend,
                        EDataBook *book,
                        guint32 opid,
-                       GCancellable *cancellable,
-                       gboolean only_if_exists)
+                       GCancellable *cancellable)
 {
        GError *error = NULL;
 
diff --git a/src/addressbook/libedata-book/e-book-backend.c b/src/addressbook/libedata-book/e-book-backend.c
index 41865c3e8..35dbb873d 100644
--- a/src/addressbook/libedata-book/e-book-backend.c
+++ b/src/addressbook/libedata-book/e-book-backend.c
@@ -1120,7 +1120,7 @@ book_backend_open_thread (GSimpleAsyncResult *simple,
 
                e_backend_ensure_online_state_updated (E_BACKEND (backend), cancellable);
 
-               class->open (backend, data_book, opid, cancellable, FALSE);
+               class->open (backend, data_book, opid, cancellable);
        }
 
        g_object_unref (data_book);
diff --git a/src/addressbook/libedata-book/e-book-backend.h b/src/addressbook/libedata-book/e-book-backend.h
index 22d0963df..ac32eb523 100644
--- a/src/addressbook/libedata-book/e-book-backend.h
+++ b/src/addressbook/libedata-book/e-book-backend.h
@@ -124,8 +124,7 @@ struct _EBookBackendClass {
        void            (*open)                 (EBookBackend *backend,
                                                 EDataBook *book,
                                                 guint32 opid,
-                                                GCancellable *cancellable,
-                                                gboolean only_if_exists);
+                                                GCancellable *cancellable);
        void            (*refresh)              (EBookBackend *backend,
                                                 EDataBook *book,
                                                 guint32 opid,
diff --git a/src/calendar/backends/contacts/e-cal-backend-contacts.c 
b/src/calendar/backends/contacts/e-cal-backend-contacts.c
index d9cff70ef..eef2fa564 100644
--- a/src/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/src/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -1197,7 +1197,6 @@ static void
 e_cal_backend_contacts_open (ECalBackendSync *backend,
                              EDataCal *cal,
                              GCancellable *cancellable,
-                             gboolean only_if_exists,
                              GError **perror)
 {
        ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
diff --git a/src/calendar/backends/file/e-cal-backend-file.c b/src/calendar/backends/file/e-cal-backend-file.c
index 7505d5006..451561c67 100644
--- a/src/calendar/backends/file/e-cal-backend-file.c
+++ b/src/calendar/backends/file/e-cal-backend-file.c
@@ -1442,7 +1442,6 @@ static void
 e_cal_backend_file_open (ECalBackendSync *backend,
                          EDataCal *cal,
                          GCancellable *cancellable,
-                         gboolean only_if_exists,
                          GError **perror)
 {
        ECalBackendFile *cbfile;
@@ -1477,10 +1476,7 @@ e_cal_backend_file_open (ECalBackendSync *backend,
                if (g_access (str_uri, W_OK) != 0)
                        writable = FALSE;
        } else {
-               if (only_if_exists)
-                       err = ECC_ERROR (E_CAL_CLIENT_ERROR_NO_SUCH_CALENDAR);
-               else
-                       create_cal (cbfile, str_uri, &err);
+               create_cal (cbfile, str_uri, &err);
        }
 
        if (!err) {
diff --git a/src/calendar/backends/weather/e-cal-backend-weather.c 
b/src/calendar/backends/weather/e-cal-backend-weather.c
index 0fa5513f1..a1ec0c2cf 100644
--- a/src/calendar/backends/weather/e-cal-backend-weather.c
+++ b/src/calendar/backends/weather/e-cal-backend-weather.c
@@ -661,7 +661,6 @@ static void
 e_cal_backend_weather_open (ECalBackendSync *backend,
                             EDataCal *cal,
                             GCancellable *cancellable,
-                            gboolean only_if_exists,
                             GError **perror)
 {
        ECalBackendWeather *cbw;
diff --git a/src/calendar/libedata-cal/e-cal-backend-sync.c b/src/calendar/libedata-cal/e-cal-backend-sync.c
index 4bf602adf..8787c78a5 100644
--- a/src/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/src/calendar/libedata-cal/e-cal-backend-sync.c
@@ -44,7 +44,6 @@ G_DEFINE_TYPE (ECalBackendSync, e_cal_backend_sync, E_TYPE_CAL_BACKEND)
  * @backend: An ECalBackendSync object.
  * @cal: An EDataCal object.
  * @cancellable: a #GCancellable for the operation
- * @only_if_exists: Whether to open the calendar if and only if it already exists
  * or just create it when it does not exist.
  * @error: Out parameter for a #GError.
  *
@@ -54,7 +53,6 @@ void
 e_cal_backend_sync_open (ECalBackendSync *backend,
                          EDataCal *cal,
                          GCancellable *cancellable,
-                         gboolean only_if_exists,
                          GError **error)
 {
        ECalBackendSyncClass *class;
@@ -65,8 +63,7 @@ e_cal_backend_sync_open (ECalBackendSync *backend,
        g_return_if_fail (class != NULL);
 
        if (class->open_sync != NULL) {
-               class->open_sync (
-                       backend, cal, cancellable, only_if_exists, error);
+               class->open_sync (backend, cal, cancellable, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -652,12 +649,11 @@ static void
 cal_backend_open (ECalBackend *backend,
                   EDataCal *cal,
                   guint32 opid,
-                  GCancellable *cancellable,
-                  gboolean only_if_exists)
+                  GCancellable *cancellable)
 {
        GError *error = NULL;
 
-       e_cal_backend_sync_open (E_CAL_BACKEND_SYNC (backend), cal, cancellable, only_if_exists, &error);
+       e_cal_backend_sync_open (E_CAL_BACKEND_SYNC (backend), cal, cancellable, &error);
 
        e_data_cal_respond_open (cal, opid, error);
 }
diff --git a/src/calendar/libedata-cal/e-cal-backend-sync.h b/src/calendar/libedata-cal/e-cal-backend-sync.h
index b0f8b85e1..90d472a7e 100644
--- a/src/calendar/libedata-cal/e-cal-backend-sync.h
+++ b/src/calendar/libedata-cal/e-cal-backend-sync.h
@@ -90,7 +90,6 @@ struct _ECalBackendSyncClass {
        void            (*open_sync)            (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
-                                                gboolean only_if_exists,
                                                 GError **error);
        void            (*refresh_sync)         (ECalBackendSync *backend,
                                                 EDataCal *cal,
@@ -194,7 +193,6 @@ GType               e_cal_backend_sync_get_type     (void) G_GNUC_CONST;
 void           e_cal_backend_sync_open         (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
-                                                gboolean only_if_exists,
                                                 GError **error);
 void           e_cal_backend_sync_refresh      (ECalBackendSync *backend,
                                                 EDataCal *cal,
diff --git a/src/calendar/libedata-cal/e-cal-backend.c b/src/calendar/libedata-cal/e-cal-backend.c
index 01bda3efc..adcd7b2a4 100644
--- a/src/calendar/libedata-cal/e-cal-backend.c
+++ b/src/calendar/libedata-cal/e-cal-backend.c
@@ -1606,7 +1606,7 @@ cal_backend_open_thread (GSimpleAsyncResult *simple,
 
                e_backend_ensure_online_state_updated (E_BACKEND (backend), cancellable);
 
-               class->open (backend, data_cal, opid, cancellable, FALSE);
+               class->open (backend, data_cal, opid, cancellable);
        }
 
        g_object_unref (data_cal);
diff --git a/src/calendar/libedata-cal/e-cal-backend.h b/src/calendar/libedata-cal/e-cal-backend.h
index 3423b1d10..9c6a5a64b 100644
--- a/src/calendar/libedata-cal/e-cal-backend.h
+++ b/src/calendar/libedata-cal/e-cal-backend.h
@@ -113,8 +113,7 @@ struct _ECalBackendClass {
        void            (*open)                 (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
-                                                GCancellable *cancellable,
-                                                gboolean only_if_exists);
+                                                GCancellable *cancellable);
 
        void            (*refresh)              (ECalBackend *backend,
                                                 EDataCal *cal,
diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c
index 94b069fea..8ca9d8237 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
@@ -1235,7 +1235,6 @@ static void
 ecmb_open_sync (ECalBackendSync *sync_backend,
                EDataCal *cal,
                GCancellable *cancellable,
-               gboolean only_if_exists,
                GError **error)
 {
        ECalMetaBackend *meta_backend;
diff --git a/src/libedataserver/e-client.c b/src/libedataserver/e-client.c
index b85f99845..aadc84c84 100644
--- a/src/libedataserver/e-client.c
+++ b/src/libedataserver/e-client.c
@@ -67,7 +67,6 @@ struct _AsyncContext {
        gchar *capabilities;
        gchar *prop_name;
        gchar *prop_value;
-       gboolean only_if_exists;
 };
 
 enum {
@@ -626,15 +625,9 @@ client_open_thread (GSimpleAsyncResult *simple,
                     GObject *source_object,
                     GCancellable *cancellable)
 {
-       AsyncContext *async_context;
        GError *error = NULL;
 
-       async_context = g_simple_async_result_get_op_res_gpointer (simple);
-
-       e_client_open_sync (
-               E_CLIENT (source_object),
-               async_context->only_if_exists,
-               cancellable, &error);
+       e_client_open_sync (E_CLIENT (source_object), FALSE, cancellable, &error);
 
        if (error != NULL)
                g_simple_async_result_take_error (simple, error);
@@ -651,7 +644,6 @@ client_open (EClient *client,
        AsyncContext *async_context;
 
        async_context = g_slice_new0 (AsyncContext);
-       async_context->only_if_exists = only_if_exists;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data, client_open);
@@ -1602,8 +1594,7 @@ e_client_set_backend_property_sync (EClient *client,
 /**
  * e_client_open:
  * @client: an #EClient
- * @only_if_exists: if %TRUE, fail if this book doesn't already exist,
- *                  otherwise create it first
+ * @only_if_exists: this parameter is not used anymore
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -1673,8 +1664,7 @@ e_client_open_finish (EClient *client,
 /**
  * e_client_open_sync:
  * @client: an #EClient
- * @only_if_exists: if %TRUE, fail if this book doesn't already exist,
- *                  otherwise create it first
+ * @only_if_exists: this parameter is not used anymore
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *


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