diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-06-27 07:51:55 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-06-27 07:51:55 +0800 |
commit | 9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d (patch) | |
tree | 99b724db2f0bbfbe4fecc414ebd62ae771b82ce4 | |
parent | 88a50331b207021cc169452bf170f9e542c0cfcd (diff) | |
download | gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar.gz gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar.bz2 gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar.lz gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar.xz gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.tar.zst gsoc2013-evolution-9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d.zip |
remove spew. (pas_backend_ldap_ensure_connected): duh, don't access a
2000-06-26 Chris Toshok <toshok@helixcode.com>
* backend/pas/pas-backend-ldap.c (poll_ldap): remove spew.
(pas_backend_ldap_ensure_connected): duh, don't access a pointer
we know to be NULL.
(query_prop_to_ldap): rename map_e_card_prop_to_ldap to this.
easier to type.
svn path=/trunk/; revision=3743
-rw-r--r-- | addressbook/ChangeLog | 8 | ||||
-rw-r--r-- | addressbook/backend/pas/pas-backend-ldap.c | 39 |
2 files changed, 26 insertions, 21 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 18000af5aa..bf93316632 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,11 @@ +2000-06-26 Chris Toshok <toshok@helixcode.com> + + * backend/pas/pas-backend-ldap.c (poll_ldap): remove spew. + (pas_backend_ldap_ensure_connected): duh, don't access a pointer + we know to be NULL. + (query_prop_to_ldap): rename map_e_card_prop_to_ldap to this. + easier to type. + 2000-06-21 Christopher James Lahey <clahey@helixcode.com> * gui/minicard/test-minicard-label.c, diff --git a/addressbook/backend/pas/pas-backend-ldap.c b/addressbook/backend/pas/pas-backend-ldap.c index 02719657c3..6282135fe0 100644 --- a/addressbook/backend/pas/pas-backend-ldap.c +++ b/addressbook/backend/pas/pas-backend-ldap.c @@ -22,7 +22,7 @@ #define LDAP_MAX_SEARCH_RESPONSES 500 -static gchar *map_e_card_prop_to_ldap(gchar *e_card_prop); +static gchar *query_prop_to_ldap(gchar *query_prop); static PASBackendClass *pas_backend_ldap_parent_class; typedef struct _PASBackendLDAPCursorPrivate PASBackendLDAPCursorPrivate; @@ -151,15 +151,14 @@ pas_backend_ldap_ensure_connected (PASBackendLDAP *bl) NULL /*binddn*/, NULL /*passwd*/); bl->priv->connected = TRUE; } - else + else { g_warning ("pas_backend_ldap_ensure_connected failed for " - "'ldap://%s:%d/%s' (error %s)\n", + "'ldap://%s:%d/%s'\n", bl->priv->ldap_host, bl->priv->ldap_port, - bl->priv->ldap_rootdn ? bl->priv->ldap_rootdn : "", - - ldap_err2string(ldap->ld_errno)); - + bl->priv->ldap_rootdn ? bl->priv->ldap_rootdn : ""); + bl->priv->connected = FALSE; + } } } @@ -403,7 +402,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data && argv[1]->type == ESEXP_RES_STRING) { char *propname = argv[0]->value.string; char *str = argv[1]->value.string; - char *ldap_attr = map_e_card_prop_to_ldap(propname); + char *ldap_attr = query_prop_to_ldap(propname); gboolean one_star = FALSE; if (strlen(str) == 0) @@ -434,7 +433,7 @@ func_is(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data) && argv[1]->type == ESEXP_RES_STRING) { char *propname = argv[0]->value.string; char *str = argv[1]->value.string; - char *ldap_attr = map_e_card_prop_to_ldap(propname); + char *ldap_attr = query_prop_to_ldap(propname); if (ldap_attr) *list = g_list_prepend(*list, @@ -459,7 +458,7 @@ func_beginswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *da && argv[1]->type == ESEXP_RES_STRING) { char *propname = argv[0]->value.string; char *str = argv[1]->value.string; - char *ldap_attr = map_e_card_prop_to_ldap(propname); + char *ldap_attr = query_prop_to_ldap(propname); gboolean one_star = FALSE; if (strlen(str) == 0) @@ -489,7 +488,7 @@ func_endswith(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data && argv[1]->type == ESEXP_RES_STRING) { char *propname = argv[0]->value.string; char *str = argv[1]->value.string; - char *ldap_attr = map_e_card_prop_to_ldap(propname); + char *ldap_attr = query_prop_to_ldap(propname); gboolean one_star = FALSE; if (strlen(str) == 0) @@ -586,23 +585,23 @@ struct prop_info { int prop_type; void (*construct_list_func)(ECardSimple *card, const char *prop, char **values); } prop_info_table[] = { - /* field_id, query prop, ldap attr, type, list construct function */ - { E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", "cn", PROP_TYPE_NORMAL, NULL }, - { E_CARD_SIMPLE_FIELD_TITLE, "title", "title", PROP_TYPE_NORMAL, NULL }, - { E_CARD_SIMPLE_FIELD_ORG_UNIT, "org", "o", PROP_TYPE_NORMAL, NULL }, - { E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "phone", "telephonenumber", PROP_TYPE_NORMAL, NULL }, - { 0 /* unused */, "email", "mail", PROP_TYPE_LIST, construct_email_list }, + /* field_id, query prop, ldap attr, type, list construct function */ + { E_CARD_SIMPLE_FIELD_FULL_NAME, "full_name", "cn", PROP_TYPE_NORMAL, NULL }, + { E_CARD_SIMPLE_FIELD_TITLE, "title", "title", PROP_TYPE_NORMAL, NULL }, + { E_CARD_SIMPLE_FIELD_ORG, "org", "o", PROP_TYPE_NORMAL, NULL }, + { E_CARD_SIMPLE_FIELD_PHONE_PRIMARY, "phone", "telephonenumber", PROP_TYPE_NORMAL, NULL }, + { 0 /* unused */, "email", "mail", PROP_TYPE_LIST, construct_email_list }, }; static int num_prop_infos = sizeof(prop_info_table) / sizeof(prop_info_table[0]); static gchar * -map_e_card_prop_to_ldap(gchar *e_card_prop) +query_prop_to_ldap(gchar *query_prop) { int i; for (i = 0; i < num_prop_infos; i ++) - if (!strcmp (e_card_prop, prop_info_table[i].query_prop)) + if (!strcmp (query_prop, prop_info_table[i].query_prop)) return prop_info_table[i].ldap_attr; return NULL; @@ -616,8 +615,6 @@ poll_ldap (PASBackendLDAPBookView *view) LDAPMessage *res, *e; GList *cards = NULL; - printf ("polling ldap server\n"); - ldap = view->blpriv->ldap; if ((rc = ldap_result (ldap, view->search_msgid, 0, NULL, &res)) |