GNOME Bugzilla – Bug 693936
shell-app-system: Ensure that we correctly order subsearches
Last modified: 2013-02-16 18:34:03 UTC
As a simple reproduction example, type "f", then type "i" and quickly delete it. Since we have the search timeout, it turns out that we actually make an initial search request for terms ["f"], and then a subsearch request for ["f"]. The subsearch for equal terms is another bug, but the ordering here is something that could happen in normal usage as well, so we should fix it as well.
Created attachment 236344 [details] [review] shell-app-system: Ensure that we correctly order subsearches As we use g_slist_prepend for efficiency when building the list of results before ordering it, we need to make sure we traverse the list of previous results backwards so that it's built in the same order.
Review of attachment 236344 [details] [review]: ::: src/shell-app-system.c @@ +781,3 @@ GSList *normalized_terms = normalize_terms (terms); + for (iter = g_list_last (previous_results); iter; iter = iter->prev) Can't you just g_slist_reverse(normalized_terms)? ::: src/shell-app-system.h @@ +58,3 @@ GSList *terms); GSList *shell_app_system_subsearch (ShellAppSystem *system, + GList *previous_results, I don't understand why the change to GList...
Review of attachment 236344 [details] [review]: ::: src/shell-app-system.c @@ +781,3 @@ GSList *normalized_terms = normalize_terms (terms); + for (iter = g_list_last (previous_results); iter; iter = iter->prev) Yeah, I can, but I figured it's slightly more efficient to traverse the list in reverse order.
Created attachment 236393 [details] [review] shell-app-system: Ensure that we correctly order subsearches As we use g_slist_prepend for efficiency when building the list of results before ordering it, we need to make sure we traverse the list of previous results backwards so that it's built in the same order.
Review of attachment 236393 [details] [review]: ++
Attachment 236393 [details] pushed as 754df5e - shell-app-system: Ensure that we correctly order subsearches