diff options
author | Chris Toshok <toshok@ximian.com> | 2003-04-09 18:15:05 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-04-09 18:15:05 +0800 |
commit | 7d976a9c3eaa3ed0b48aa1c000312e78c3a8b0b6 (patch) | |
tree | 76a37d83941dd07416003c17fe0609e31e9de53f | |
parent | 60ba84e6a404f0553479b546234cb9d1ddec73ba (diff) | |
download | gsoc2013-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
-rw-r--r-- | addressbook/ChangeLog | 9 | ||||
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-completion.c | 14 |
2 files changed, 18 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 393672f4b3..1a593d0e60 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,12 @@ +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. + 2003-04-08 Ettore Perazzoli <ettore@ximian.com> * backend/ebook/e-destination.c (d): Remove all debugging 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) { |