aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2003-04-09 18:15:05 +0800
committerChris Toshok <toshok@src.gnome.org>2003-04-09 18:15:05 +0800
commit7d976a9c3eaa3ed0b48aa1c000312e78c3a8b0b6 (patch)
tree76a37d83941dd07416003c17fe0609e31e9de53f /addressbook/gui
parent60ba84e6a404f0553479b546234cb9d1ddec73ba (diff)
downloadgsoc2013-evolution-7d976a9c3eaa3ed0b48aa1c000312e78c3a8b0b6.tar.gz
gsoc2013-evolution-7d976a9c3eaa3ed0b48aa1c000312e78c3a8b0b6.tar.zst
gsoc2013-evolution-7d976a9c3eaa3ed0b48aa1c000312e78c3a8b0b6.zip
[ fixes #40727 ] if the query text is either shorter than the cached
2003-04-09 Chris Toshok <toshok@ximian.com> [ fixes #40727 ] * gui/component/select-names/e-select-names-completion.c (e_select_names_completion_start_query): if the query text is either shorter than the cached query_text or they don't match, don't just set can_reuse_cached_cards to FALSE. we also need to invalidate the cache. svn path=/trunk/; revision=20780
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-completion.c b/addressbook/gui/component/select-names/e-select-names-completion.c
index 81f5d12353..06e890f468 100644
--- a/addressbook/gui/component/select-names/e-select-names-completion.c
+++ b/addressbook/gui/component/select-names/e-select-names-completion.c
@@ -661,7 +661,6 @@ e_select_names_completion_clear_book_data (ESelectNamesCompletion *comp)
g_list_foreach (book_data->cached_cards, (GFunc)g_object_unref, NULL);
g_list_free (book_data->cached_cards);
-
g_free (book_data);
}
g_list_free (comp->priv->book_data);
@@ -945,12 +944,17 @@ e_select_names_completion_start_query (ESelectNamesCompletion *comp, const gchar
book_data->cached_cards);
}
+ /* for lack of a better place, we invalidate the cache here if we
+ notice that the text is different. */
+ if (book_data->cached_query_text
+ && (strlen (book_data->cached_query_text) > strlen (query_text)
+ || utf8_casefold_collate_len (book_data->cached_query_text, query_text,
+ strlen (book_data->cached_query_text))))
+ book_data->cache_complete = FALSE;
+
can_reuse_cached_cards = (book_data->cached_query_text
&& book_data->cache_complete
- && book_data->cached_cards != NULL
- && (strlen (book_data->cached_query_text) <= strlen (query_text))
- && !utf8_casefold_collate_len (book_data->cached_query_text, query_text,
- strlen (book_data->cached_query_text)));
+ && book_data->cached_cards != NULL);
if (can_reuse_cached_cards) {