ShellContactSystem: Make address search actually work

The code was not dealing properly with what folks returns
for im and email addresses.

https://bugzilla.gnome.org/show_bug.cgi?id=660925
This commit is contained in:
Matthias Clasen 2011-10-04 16:19:09 -04:00 committed by Florian Müllner
parent 492dd718fb
commit 472b20d933

View File

@ -188,7 +188,8 @@ do_match (ShellContactSystem *self,
while (gee_iterator_next (addrs_iter))
{
const gchar *addr = gee_iterator_get (addrs_iter);
FolksImFieldDetails *field = gee_iterator_get (addrs_iter);
const gchar *addr = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*)field);
p = strstr (addr, term);
if (p == addr)
@ -201,13 +202,16 @@ do_match (ShellContactSystem *self,
have_addr_substring = TRUE;
matched = TRUE;
}
g_object_unref (field);
}
g_object_unref (addrs_iter);
addrs_iter = gee_iterable_iterator (GEE_ITERABLE (email_addrs));
while (gee_iterator_next (addrs_iter))
{
const gchar *addr = gee_iterator_get (addrs_iter);
FolksEmailFieldDetails *field = gee_iterator_get (addrs_iter);
const gchar *addr = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*)field);
p = strstr (addr, term);
if (p == addr)
@ -220,6 +224,8 @@ do_match (ShellContactSystem *self,
have_addr_substring = TRUE;
matched = TRUE;
}
g_object_unref (field);
}
g_object_unref (addrs_iter);