evolution-exchange r1748 - in trunk: . addressbook camel
- From: msuman svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-exchange r1748 - in trunk: . addressbook camel
- Date: Mon, 18 Aug 2008 05:03:36 +0000 (UTC)
Author: msuman
Date: Mon Aug 18 05:03:35 2008
New Revision: 1748
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1748&view=rev
Log:
Milan Crha <mcrha redhat com> ** Fix for bug #324203 (New entry to select whether allows GAL browsing or not, Check whether browsing of the GAL is requested or not and act based on that).
Modified:
trunk/ChangeLog
trunk/addressbook/e-book-backend-gal.c
trunk/camel/camel-exchange-provider.c
Modified: trunk/addressbook/e-book-backend-gal.c
==============================================================================
--- trunk/addressbook/e-book-backend-gal.c (original)
+++ trunk/addressbook/e-book-backend-gal.c Mon Aug 18 05:03:35 2008
@@ -216,6 +216,15 @@
static int num_prop_infos = sizeof(prop_info) / sizeof(prop_info[0]);
+static gboolean
+can_browse (EBookBackend *backend)
+{
+ return backend &&
+ e_book_backend_get_source (backend) &&
+ e_source_get_property (e_book_backend_get_source (backend), "can-browse") &&
+ strcmp (e_source_get_property (e_book_backend_get_source (backend), "can-browse"), "1") == 0;
+}
+
static void
book_view_notify_status (EDataBookView *view, const char *status)
{
@@ -1188,7 +1197,8 @@
if (!r) {
/* Bad query or it isn't supported */
*ldap_query = NULL;
- retval = GNOME_Evolution_Addressbook_QueryRefused;
+ e_sexp_unref (sexp);
+ return GNOME_Evolution_Addressbook_QueryRefused;
}
if (r->type == ESEXP_RES_STRING) {
@@ -1646,7 +1656,10 @@
}
ldap_memfree (ldap_error_msg);
- if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
+ if ((ldap_error == LDAP_TIMELIMIT_EXCEEDED || ldap_error == LDAP_SIZELIMIT_EXCEEDED) && can_browse ((EBookBackend *)bl))
+ /* do not complain when search limit exceeded for browsable LDAPs */
+ e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_Success);
+ else if (ldap_error == LDAP_TIMELIMIT_EXCEEDED)
e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_SearchTimeLimitExceeded);
else if (ldap_error == LDAP_SIZELIMIT_EXCEEDED)
e_data_book_view_notify_complete (view, GNOME_Evolution_Addressbook_SearchSizeLimitExceeded);
@@ -1757,6 +1770,13 @@
status = build_query (bl, e_data_book_view_get_card_query (view),
&ldap_query);
+
+ /* search for anything */
+ if (!ldap_query && (status == GNOME_Evolution_Addressbook_QueryRefused || status == GNOME_Evolution_Addressbook_Success) && can_browse ((EBookBackend *)bl)) {
+ ldap_query = g_strdup ("(mail=*)");
+ status = GNOME_Evolution_Addressbook_Success;
+ }
+
if (status != GNOME_Evolution_Addressbook_Success || !ldap_query) {
e_data_book_view_notify_complete (view, status);
if (ldap_query)
@@ -1817,7 +1837,14 @@
status = build_query (bl, e_data_book_view_get_card_query (view),
&ldap_query);
- printf("%s:%s: %s\n", G_STRLOC, G_STRFUNC, ldap_query);
+
+ /* search for anything */
+ if (!ldap_query && (status == GNOME_Evolution_Addressbook_QueryRefused || status == GNOME_Evolution_Addressbook_Success) && can_browse ((EBookBackend *)bl)) {
+ ldap_query = g_strdup ("(mail=*)");
+ status = GNOME_Evolution_Addressbook_Success;
+ }
+
+ printf("%s:%s: %s\n", G_STRLOC, G_STRFUNC, ldap_query ? ldap_query : "No ldap_query produced!");
if (status != GNOME_Evolution_Addressbook_Success || !ldap_query) {
e_data_book_view_notify_complete (view, status);
if (ldap_query)
@@ -2628,7 +2655,10 @@
static char *
get_static_capabilities (EBookBackend *backend)
{
- return g_strdup("net");
+ if (can_browse (backend))
+ return g_strdup ("net,do-initial-query");
+ else
+ return g_strdup ("net");
}
/**
Modified: trunk/camel/camel-exchange-provider.c
==============================================================================
--- trunk/camel/camel-exchange-provider.c (original)
+++ trunk/camel/camel-exchange-provider.c Mon Aug 18 05:03:35 2008
@@ -84,6 +84,8 @@
N_("_Limit number of GAL responses: %s"), "y:1:500:10000" },
{ CAMEL_PROVIDER_CONF_OPTIONS, "ad_auth", NULL,
N_("Authentication _Type:"), "default:Secure or Plaintext Password:basic:Plaintext Password:ntlm:Secure Password" },
+ { CAMEL_PROVIDER_CONF_CHECKBOX, "ad_browse", NULL,
+ N_("Allow _browsing of the GAL until download limit is reached"), "0" },
{ CAMEL_PROVIDER_CONF_SECTION_END },
{ CAMEL_PROVIDER_CONF_SECTION_START, "generals", NULL,
N_("Options") },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]