[Evolution] Contacts / LDAP again.



Sorry to be a pain about this, but category searching is a vital part of
organizing our contact db. I have been told that to use the category
search facilities, we need to upgrade to Beta 2, and migrate our LDAP
repository to using the new schema with "category" instead of
"categories". This isn't a problem, as I've knocked up a Perl script to
split them out, and will just update the DB.

However, the new schema is in the source dist, so I had a little dig
around to see what I could see.

I'm not convinced that category matching will work properly anyway.
According to the source for category_compare(), it concatenates the
category values and strcmp()'s them. Surely this isn't what is required?
A contact would need to be in all the categories to match?

static gboolean
category_compare (ECardSimple *ecard1, ECardSimple *ecard2)
{
        char *categories1, *categories2;
        gboolean equal;

        categories1 = e_card_simple_get (ecard1,
E_CARD_SIMPLE_FIELD_CATEGORIES);
        categories2 = e_card_simple_get (ecard2,
E_CARD_SIMPLE_FIELD_CATEGORIES);

        equal = !strcmp (categories1, categories2);

        g_free (categories1);
        g_free (categories2);

        return equal;
}

maybe strstr() or something like that?

Is the source consistently using the new multivalued "category" field
anyway?

-- 
Greg Kerdemelidis  greg advance-enterprise com
Java/C/Perl Developer; Network Administrator
Advance Enterprise Ltd




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