aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog9
-rw-r--r--addressbook/gui/component/select-names/e-select-names-completion.c14
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) {