diff options
Diffstat (limited to 'addressbook')
| -rw-r--r-- | addressbook/libebook/e-book-client-view.c | 21 | ||||
| -rw-r--r-- | addressbook/libebook/e-book-client-view.h | 2 | ||||
| -rw-r--r-- | addressbook/libedata-book/e-data-book-view.c | 40 | ||||
| -rw-r--r-- | addressbook/libedata-book/e-data-book-view.h | 2 | ||||
| -rw-r--r-- | addressbook/libegdbus/e-gdbus-book-view.c | 24 | ||||
| -rw-r--r-- | addressbook/libegdbus/e-gdbus-book-view.h | 16 |
6 files changed, 55 insertions, 50 deletions
diff --git a/addressbook/libebook/e-book-client-view.c b/addressbook/libebook/e-book-client-view.c index 28ecd891a..8b99cf26d 100644 --- a/addressbook/libebook/e-book-client-view.c +++ b/addressbook/libebook/e-book-client-view.c @@ -249,19 +249,24 @@ e_book_client_view_stop (EBookClientView *view, GError **error) } /** - * e_book_client_view_set_restriction: + * e_book_client_view_set_fields_of_interest: * @view: An #EBookClientView object - * @only_fields: List of field names to restrict result on + * @fields_of_interest: List of field names in which the client is interested * @error: A #GError * * Client can instruct server to which fields it is interested in only, thus * the server can return less data over the wire. The server can still return * complete objects, this is just a hint to it that the listed fields will - * be used only. The UID field is returned always. Initial views has no restriction, - * and using %NULL for @only_fields will unset any previous changes. + * be used only. The UID field is returned always. Initial views has no fields + * of interest and using %NULL for @fields_of_interest will unset any previous + * changes. + * + * Some backends can use summary information of its cache to create artifical + * objects, which will omit stored object parsing. If this cannot be done then + * it will simply return object as is stored in the cache. **/ void -e_book_client_view_set_restriction (EBookClientView *view, const GSList *only_fields, GError **error) +e_book_client_view_set_fields_of_interest (EBookClientView *view, const GSList *fields_of_interest, GError **error) { EBookClientViewPrivate *priv; @@ -274,13 +279,13 @@ e_book_client_view_set_restriction (EBookClientView *view, const GSList *only_fi GError *local_error = NULL; gchar **strv; - strv = e_client_util_slist_to_strv (only_fields); - e_gdbus_book_view_call_set_restriction_sync (priv->gdbus_bookview, (const gchar * const *) strv, NULL, &local_error); + strv = e_client_util_slist_to_strv (fields_of_interest); + e_gdbus_book_view_call_set_fields_of_interest_sync (priv->gdbus_bookview, (const gchar * const *) strv, NULL, &local_error); g_strfreev (strv); e_client_util_unwrap_dbus_error (local_error, error, NULL, 0, 0, FALSE); } else { - g_set_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR, _("Cannot set restriction, D-Bus proxy gone")); + g_set_error (error, G_IO_ERROR, G_IO_ERROR_DBUS_ERROR, _("Cannot set fields of interest, D-Bus proxy gone")); } } diff --git a/addressbook/libebook/e-book-client-view.h b/addressbook/libebook/e-book-client-view.h index ef814c5a8..c11495d62 100644 --- a/addressbook/libebook/e-book-client-view.h +++ b/addressbook/libebook/e-book-client-view.h @@ -62,7 +62,7 @@ struct _EBookClientViewClass { GType e_book_client_view_get_type (void); struct _EBookClient * e_book_client_view_get_client (EBookClientView *view); gboolean e_book_client_view_is_running (EBookClientView *view); -void e_book_client_view_set_restriction (EBookClientView *view, const GSList *only_fields, GError **error); +void e_book_client_view_set_fields_of_interest(EBookClientView *view, const GSList *fields_of_interest, GError **error); void e_book_client_view_start (EBookClientView *view, GError **error); void e_book_client_view_stop (EBookClientView *view, GError **error); diff --git a/addressbook/libedata-book/e-data-book-view.c b/addressbook/libedata-book/e-data-book-view.c index 685d78471..6666cb55f 100644 --- a/addressbook/libedata-book/e-data-book-view.c +++ b/addressbook/libedata-book/e-data-book-view.c @@ -60,8 +60,8 @@ struct _EDataBookViewPrivate { guint flush_id; - /* restriction which fields is listener interested in */ - GHashTable *only_fields; + /* which fields is listener interested in */ + GHashTable *fields_of_interest; }; static void e_data_book_view_dispose (GObject *object); @@ -284,32 +284,32 @@ notify_add (EDataBookView *view, const gchar *id, const gchar *vcard) } static gboolean -impl_DataBookView_setRestriction (EGdbusBookView *object, GDBusMethodInvocation *invocation, const gchar * const *in_only_fields, EDataBookView *view) +impl_DataBookView_setFieldsOfInterest (EGdbusBookView *object, GDBusMethodInvocation *invocation, const gchar * const *in_fields_of_interest, EDataBookView *view) { EDataBookViewPrivate *priv; gint ii; - g_return_val_if_fail (in_only_fields != NULL, TRUE); + g_return_val_if_fail (in_fields_of_interest != NULL, TRUE); priv = view->priv; - if (priv->only_fields) - g_hash_table_destroy (priv->only_fields); - priv->only_fields = NULL; + if (priv->fields_of_interest) + g_hash_table_destroy (priv->fields_of_interest); + priv->fields_of_interest = NULL; - for (ii = 0; in_only_fields[ii]; ii++) { - const gchar *field = in_only_fields[ii]; + for (ii = 0; in_fields_of_interest[ii]; ii++) { + const gchar *field = in_fields_of_interest[ii]; if (!*field) continue; - if (!priv->only_fields) - priv->only_fields = g_hash_table_new_full (str_ic_hash, str_ic_equal, g_free, NULL); + if (!priv->fields_of_interest) + priv->fields_of_interest = g_hash_table_new_full (str_ic_hash, str_ic_equal, g_free, NULL); - g_hash_table_insert (priv->only_fields, g_strdup (field), GINT_TO_POINTER (1)); + g_hash_table_insert (priv->fields_of_interest, g_strdup (field), GINT_TO_POINTER (1)); } - e_gdbus_book_view_complete_set_restriction (object, invocation, NULL); + e_gdbus_book_view_complete_set_fields_of_interest (object, invocation, NULL); return TRUE; } @@ -672,9 +672,9 @@ e_data_book_view_init (EDataBookView *book_view) g_signal_connect (priv->gdbus_object, "handle-start", G_CALLBACK (impl_DataBookView_start), book_view); g_signal_connect (priv->gdbus_object, "handle-stop", G_CALLBACK (impl_DataBookView_stop), book_view); g_signal_connect (priv->gdbus_object, "handle-dispose", G_CALLBACK (impl_DataBookView_dispose), book_view); - g_signal_connect (priv->gdbus_object, "handle-set-restriction", G_CALLBACK (impl_DataBookView_setRestriction), book_view); + g_signal_connect (priv->gdbus_object, "handle-set-fields-of-interest", G_CALLBACK (impl_DataBookView_setFieldsOfInterest), book_view); - priv->only_fields = NULL; + priv->fields_of_interest = NULL; priv->running = FALSE; priv->pending_mutex = g_mutex_new (); @@ -741,8 +741,8 @@ e_data_book_view_finalize (GObject *object) g_array_free (priv->removes, TRUE); g_free (priv->card_query); - if (priv->only_fields) - g_hash_table_destroy (priv->only_fields); + if (priv->fields_of_interest) + g_hash_table_destroy (priv->fields_of_interest); g_mutex_free (priv->pending_mutex); @@ -802,7 +802,7 @@ e_data_book_view_get_backend (EDataBookView *book_view) } /** - * e_data_book_view_get_restriction: + * e_data_book_view_get_fields_of_interest: * @view: A view object. * * Returns: Hash table of field names which the listener is interested in. @@ -814,11 +814,11 @@ e_data_book_view_get_backend (EDataBookView *book_view) * compared case insensitively. **/ /* const */ GHashTable * -e_data_book_view_get_restriction (EDataBookView *view) +e_data_book_view_get_fields_of_interest (EDataBookView *view) { g_return_val_if_fail (E_IS_DATA_BOOK_VIEW (view), NULL); - return view->priv->only_fields; + return view->priv->fields_of_interest; } /** diff --git a/addressbook/libedata-book/e-data-book-view.h b/addressbook/libedata-book/e-data-book-view.h index 40ef59dbb..9a19aad87 100644 --- a/addressbook/libedata-book/e-data-book-view.h +++ b/addressbook/libedata-book/e-data-book-view.h @@ -70,7 +70,7 @@ void e_data_book_view_notify_progress (EDataBookView *book_view, guint void e_data_book_view_ref (EDataBookView *book_view); void e_data_book_view_unref (EDataBookView *book_view); -/* const */ GHashTable *e_data_book_view_get_restriction (EDataBookView *view); +/* const */ GHashTable *e_data_book_view_get_fields_of_interest (EDataBookView *view); G_END_DECLS diff --git a/addressbook/libegdbus/e-gdbus-book-view.c b/addressbook/libegdbus/e-gdbus-book-view.c index dfa40a53f..d73ae51c6 100644 --- a/addressbook/libegdbus/e-gdbus-book-view.c +++ b/addressbook/libegdbus/e-gdbus-book-view.c @@ -43,7 +43,7 @@ enum __START_METHOD, __STOP_METHOD, __DISPOSE_METHOD, - __SET_RESTRICTION_METHOD, + __SET_FIELDS_OF_INTEREST_METHOD, __LAST_SIGNAL }; @@ -108,10 +108,10 @@ e_gdbus_book_view_default_init (EGdbusBookViewIface *iface) E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "Complete", complete, __COMPLETE_SIGNAL) /* GObject signals definitions for D-Bus methods: */ - E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "start", start, __START_METHOD) - E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "stop", stop, __STOP_METHOD) - E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "dispose", dispose, __DISPOSE_METHOD) - E_INIT_GDBUS_METHOD_STRV (EGdbusBookViewIface, "setRestriction", set_restriction, __SET_RESTRICTION_METHOD) + E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "start", start, __START_METHOD) + E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "stop", stop, __STOP_METHOD) + E_INIT_GDBUS_METHOD_VOID (EGdbusBookViewIface, "dispose", dispose, __DISPOSE_METHOD) + E_INIT_GDBUS_METHOD_STRV (EGdbusBookViewIface, "setFieldsOfInterest", set_fields_of_interest, __SET_FIELDS_OF_INTEREST_METHOD) } void @@ -169,21 +169,21 @@ e_gdbus_book_view_call_dispose_sync (GDBusProxy *proxy, GCancellable *cancellabl } void -e_gdbus_book_view_call_set_restriction (GDBusProxy *proxy, const gchar * const *in_only_fields, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) +e_gdbus_book_view_call_set_fields_of_interest (GDBusProxy *proxy, const gchar * const *in_only_fields, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) { - e_gdbus_proxy_method_call_strv ("setRestriction", proxy, in_only_fields, cancellable, callback, user_data); + e_gdbus_proxy_method_call_strv ("setFieldsOfInterest", proxy, in_only_fields, cancellable, callback, user_data); } gboolean -e_gdbus_book_view_call_set_restriction_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error) +e_gdbus_book_view_call_set_fields_of_interest_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error) { return e_gdbus_proxy_method_call_finish_void (proxy, result, error); } gboolean -e_gdbus_book_view_call_set_restriction_sync (GDBusProxy *proxy, const gchar * const *in_only_fields, GCancellable *cancellable, GError **error) +e_gdbus_book_view_call_set_fields_of_interest_sync (GDBusProxy *proxy, const gchar * const *in_only_fields, GCancellable *cancellable, GError **error) { - return e_gdbus_proxy_method_call_sync_strv__void ("setRestriction", proxy, in_only_fields, cancellable, error); + return e_gdbus_proxy_method_call_sync_strv__void ("setFieldsOfInterest", proxy, in_only_fields, cancellable, error); } void @@ -225,14 +225,14 @@ E_DECLARE_GDBUS_NOTIFY_SIGNAL_1 (book_view, Complete, error, "as") E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view, start) E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view, stop) E_DECLARE_GDBUS_SYNC_METHOD_0 (book_view, dispose) -E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view, setRestriction, only_fields, "as") +E_DECLARE_GDBUS_SYNC_METHOD_1 (book_view, setFieldsOfInterest, fields_of_interest, "as") static const GDBusMethodInfo * const e_gdbus_book_view_method_info_pointers[] = { &E_DECLARED_GDBUS_METHOD_INFO_NAME (book_view, start), &E_DECLARED_GDBUS_METHOD_INFO_NAME (book_view, stop), &E_DECLARED_GDBUS_METHOD_INFO_NAME (book_view, dispose), - &E_DECLARED_GDBUS_METHOD_INFO_NAME (book_view, setRestriction), + &E_DECLARED_GDBUS_METHOD_INFO_NAME (book_view, setFieldsOfInterest), NULL }; diff --git a/addressbook/libegdbus/e-gdbus-book-view.h b/addressbook/libegdbus/e-gdbus-book-view.h index e959afd0e..3f750dafc 100644 --- a/addressbook/libegdbus/e-gdbus-book-view.h +++ b/addressbook/libegdbus/e-gdbus-book-view.h @@ -115,7 +115,7 @@ struct _EGdbusBookViewIface gboolean (*handle_start) (EGdbusBookView *object, GDBusMethodInvocation *invocation); gboolean (*handle_stop) (EGdbusBookView *object, GDBusMethodInvocation *invocation); gboolean (*handle_dispose) (EGdbusBookView *object, GDBusMethodInvocation *invocation); - gboolean (*handle_set_restriction) (EGdbusBookView *object, GDBusMethodInvocation *invocation, const gchar * const *in_only_fields); + gboolean (*handle_set_fields_of_interest)(EGdbusBookView *object, GDBusMethodInvocation *invocation, const gchar * const *in_only_fields); }; /* D-Bus Methods */ @@ -131,15 +131,15 @@ void e_gdbus_book_view_call_dispose (GDBusProxy *proxy, GCancellable *cancella gboolean e_gdbus_book_view_call_dispose_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error); gboolean e_gdbus_book_view_call_dispose_sync (GDBusProxy *proxy, GCancellable *cancellable, GError **error); -void e_gdbus_book_view_call_set_restriction (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -gboolean e_gdbus_book_view_call_set_restriction_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error); -gboolean e_gdbus_book_view_call_set_restriction_sync (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GError **error); +void e_gdbus_book_view_call_set_fields_of_interest (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); +gboolean e_gdbus_book_view_call_set_fields_of_interest_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error); +gboolean e_gdbus_book_view_call_set_fields_of_interest_sync (GDBusProxy *proxy, const gchar * const *in_only_fileds, GCancellable *cancellable, GError **error); /* D-Bus Methods Completion Helpers */ -#define e_gdbus_book_view_complete_start e_gdbus_complete_sync_method_void -#define e_gdbus_book_view_complete_stop e_gdbus_complete_sync_method_void -#define e_gdbus_book_view_complete_dispose e_gdbus_complete_sync_method_void -#define e_gdbus_book_view_complete_set_restriction e_gdbus_complete_sync_method_void +#define e_gdbus_book_view_complete_start e_gdbus_complete_sync_method_void +#define e_gdbus_book_view_complete_stop e_gdbus_complete_sync_method_void +#define e_gdbus_book_view_complete_dispose e_gdbus_complete_sync_method_void +#define e_gdbus_book_view_complete_set_fields_of_interest e_gdbus_complete_sync_method_void /* D-Bus Signal Emission Helpers */ |
