talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 00d6ca02ceea603cb479bfd062732e1d18f6d21d
parent 5baba3b17f86def8aeec177838cb4a24b9d552a8
Author: Colin Leroy <colin@colino.net>
Date:   Thu, 16 Dec 2010 08:16:22 +0000

2010-12-16 [colin]	3.7.8cvs3

	* src/prefs_matcher.c
		Fix bug #2279, "crash when clicking 'define' in filter
		configuring". Thanks to Theodor Ciobanu for the hint at
		the problem.

Diffstat:
MChangeLog | 7+++++++
MPATCHSETS | 1+
Mconfigure.ac | 2+-
Msrc/prefs_matcher.c | 40++++++++++++++++++++++++++++++++++++++--
4 files changed, 47 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,10 @@ +2010-12-16 [colin] 3.7.8cvs3 + + * src/prefs_matcher.c + Fix bug #2279, "crash when clicking 'define' in filter + configuring". Thanks to Theodor Ciobanu for the hint at + the problem. + 2010-12-14 [colin] 3.7.8cvs2 * src/gtk/gtkaspell.c diff --git a/PATCHSETS b/PATCHSETS @@ -4076,3 +4076,4 @@ ( cvs diff -u -r 1.1.2.2 -r 1.1.2.3 manual/de/dist/pdf/Makefile.am; ) > 3.7.7cvs12.patchset ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 tools/make.themes.project; ) > 3.7.8cvs1.patchset ( cvs diff -u -r 1.9.2.69 -r 1.9.2.70 src/gtk/gtkaspell.c; ) > 3.7.8cvs2.patchset +( cvs diff -u -r 1.43.2.85 -r 1.43.2.86 src/prefs_matcher.c; ) > 3.7.8cvs3.patchset diff --git a/configure.ac b/configure.ac @@ -12,7 +12,7 @@ MINOR_VERSION=7 MICRO_VERSION=8 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=2 +EXTRA_VERSION=3 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/prefs_matcher.c b/src/prefs_matcher.c @@ -869,6 +869,40 @@ static void prefs_matcher_list_view_set_row(GtkTreeIter *row, MatcherProp *prop) g_free(matcher_str); } +static gboolean match_combo2_model_set(void) +{ + GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(matcher.match_combo2)); + if (model == matcher.model_age_units || + model == matcher.model_found || + model == matcher.model_partial || + model == matcher.model_phrase || + model == matcher.model_set || + model == matcher.model_size_units || + model == matcher.model_tags || + model == matcher.model_thread) + return TRUE; + else + debug_print("match_combo2 model unset.\n"); + + return FALSE; +} + +static gboolean match_combo_model_set(void) +{ + GtkTreeModel *model = gtk_combo_box_get_model(GTK_COMBO_BOX(matcher.match_combo)); + if (model == matcher.model_age || + model == matcher.model_contain || + model == matcher.model_flags || + model == matcher.model_score || + model == matcher.model_size || + model == matcher.model_test) + return TRUE; + else + debug_print("match_combo model unset.\n"); + + return FALSE; +} + /*! *\brief Clears a condition in the list widget */ @@ -876,8 +910,10 @@ static void prefs_matcher_reset_condition(void) { gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.criteria_combo), MATCH_ALL); gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.criteria_combo2), 0); - gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo), 0); - gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo2), 0); + if (match_combo_model_set()) + gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo), 0); + if (match_combo2_model_set()) + gtk_combo_box_set_active(GTK_COMBO_BOX(matcher.match_combo2), 0); gtk_cmoption_menu_set_history(GTK_CMOPTION_MENU(matcher.color_optmenu), 0); gtk_spin_button_set_value(GTK_SPIN_BUTTON(matcher.numeric_entry), 0); gtk_entry_set_text(GTK_ENTRY(matcher.header_entry), "");