2012-09-25 [mones] 3.8.1cvs73

* src/gtk/quicksearch.c
		Fix new expressions not being added to quicksearch
		history in extended mode; patch by Sean Buckheister
This commit is contained in:
Ricardo Mones 2012-09-25 09:24:14 +00:00
parent b64d8c298c
commit f8e7417ff3
4 changed files with 47 additions and 29 deletions

View file

@ -1,3 +1,9 @@
2012-09-25 [mones] 3.8.1cvs73
* src/gtk/quicksearch.c
Fix new expressions not being added to quicksearch
history in extended mode; patch by Sean Buckheister
2012-09-22 [mir] 3.8.1cvs72
* src/advsearch.c

View file

@ -4447,3 +4447,4 @@
( cvs diff -u -r 1.213.2.212 -r 1.213.2.213 src/folder.c; ) > 3.8.1cvs70.patchset
( cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/advsearch.c; ) > 3.8.1cvs71.patchset
( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 src/advsearch.c; ) > 3.8.1cvs72.patchset
( cvs diff -u -r 1.1.2.113 -r 1.1.2.114 src/gtk/quicksearch.c; ) > 3.8.1cvs73.patchset

View file

@ -12,7 +12,7 @@ MINOR_VERSION=8
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
EXTRA_VERSION=72
EXTRA_VERSION=73
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=

View file

@ -88,6 +88,7 @@ struct _QuickSearch
AdvancedSearch *asearch;
gboolean want_reexec;
gboolean want_history;
};
void quicksearch_set_on_progress_cb(QuickSearch* search,
@ -99,6 +100,40 @@ void quicksearch_set_on_progress_cb(QuickSearch* search,
static void quicksearch_set_running(QuickSearch *quicksearch, gboolean run);
static void quicksearch_set_matchstring(QuickSearch *quicksearch, const gchar *matchstring);
static void quicksearch_set_active(QuickSearch *quicksearch, gboolean active);
static void quicksearch_set_popdown_strings(QuickSearch *quicksearch);
static void quicksearch_add_to_history(QuickSearch* quicksearch)
{
gchar* search_string = quicksearch->request.matchstring;
/* add to history, for extended search add only correct matching rules */
if (quicksearch->want_history && !quicksearch->in_typing && search_string && strlen(search_string) != 0) {
switch (prefs_common.summary_quicksearch_type) {
case ADVANCED_SEARCH_EXTENDED:
if (advsearch_has_proper_predicate(quicksearch->asearch)) {
quicksearch->extended_search_strings =
add_history(quicksearch->extended_search_strings,
g_strdup(search_string));
prefs_common.summary_quicksearch_history =
add_history(prefs_common.summary_quicksearch_history,
g_strdup(search_string));
}
break;
default:
quicksearch->normal_search_strings =
add_history(quicksearch->normal_search_strings,
g_strdup(search_string));
prefs_common.summary_quicksearch_history =
add_history(prefs_common.summary_quicksearch_history,
g_strdup(search_string));
break;
}
quicksearch_set_popdown_strings(quicksearch);
}
quicksearch->want_history = FALSE;
}
static void quicksearch_invoke_execute(QuickSearch *quicksearch, gboolean run_only_if_fast)
{
@ -116,6 +151,8 @@ static void quicksearch_invoke_execute(QuickSearch *quicksearch, gboolean run_on
if (run_only_if_fast && !advsearch_is_fast(quicksearch->asearch))
return;
quicksearch_add_to_history(quicksearch);
quicksearch_set_active(quicksearch, active);
quicksearch->want_reexec = FALSE;
@ -218,36 +255,10 @@ static void searchbar_run(QuickSearch *quicksearch, gboolean run_only_if_fast)
{
gchar *search_string = quicksearch_get_text(quicksearch);
quicksearch_set_matchstring(quicksearch, search_string);
/* add to history, for extended search add only correct matching rules */
if (!quicksearch->in_typing && search_string && strlen(search_string) != 0) {
switch (prefs_common.summary_quicksearch_type) {
case ADVANCED_SEARCH_EXTENDED:
if (advsearch_has_proper_predicate(quicksearch->asearch)) {
quicksearch->extended_search_strings =
add_history(quicksearch->extended_search_strings,
g_strdup(search_string));
prefs_common.summary_quicksearch_history =
add_history(prefs_common.summary_quicksearch_history,
g_strdup(search_string));
}
break;
default:
quicksearch->normal_search_strings =
add_history(quicksearch->normal_search_strings,
g_strdup(search_string));
prefs_common.summary_quicksearch_history =
add_history(prefs_common.summary_quicksearch_history,
g_strdup(search_string));
break;
}
quicksearch_set_popdown_strings(quicksearch);
}
g_free(search_string);
quicksearch->want_history = TRUE;
quicksearch_invoke_execute(quicksearch, run_only_if_fast);
}