2007-04-14 [colin] 2.8.1cvs99
authorColin Leroy <colin@colino.net>
Sat, 14 Apr 2007 12:16:24 +0000 (12:16 +0000)
committerColin Leroy <colin@colino.net>
Sat, 14 Apr 2007 12:16:24 +0000 (12:16 +0000)
* src/message_search.c
* src/prefs_display_header.c
* src/summary_search.c
* src/gtk/combobox.c
Fix allocations

ChangeLog
PATCHSETS
configure.ac
src/gtk/combobox.c
src/message_search.c
src/prefs_display_header.c
src/summary_search.c

index 36d2f04..be7027a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-04-14 [colin]     2.8.1cvs99
+
+       * src/message_search.c
+       * src/prefs_display_header.c
+       * src/summary_search.c
+       * src/gtk/combobox.c
+               Fix allocations
+
 2007-04-14 [wwp]       2.8.1cvs98
 
        * src/gtk/combobox.c
index cea0030..32f3e34 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.3.12.24 -r 1.3.12.25 src/message_search.c;  cvs diff -u -r 1.16.2.24 -r 1.16.2.25 src/prefs_display_header.c;  cvs diff -u -r 1.15.2.45 -r 1.15.2.46 src/summary_search.c;  ) > 2.8.1cvs96.patchset
 ( cvs diff -u -r 1.1.2.65 -r 1.1.2.66 src/gtk/quicksearch.c;  ) > 2.8.1cvs97.patchset
 ( cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/gtk/combobox.c;  cvs diff -u -r 1.3.12.25 -r 1.3.12.26 src/message_search.c;  cvs diff -u -r 1.15.2.46 -r 1.15.2.47 src/summary_search.c;  cvs diff -u -r 1.16.2.25 -r 1.16.2.26 src/prefs_display_header.c;  ) > 2.8.1cvs98.patchset
+( cvs diff -u -r 1.3.12.26 -r 1.3.12.27 src/message_search.c;  cvs diff -u -r 1.16.2.26 -r 1.16.2.27 src/prefs_display_header.c;  cvs diff -u -r 1.15.2.47 -r 1.15.2.48 src/summary_search.c;  cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/gtk/combobox.c;  ) > 2.8.1cvs99.patchset
index 649ebfb..80a29f5 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=98
+EXTRA_VERSION=99
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 4620ff9..49a65ca 100644 (file)
@@ -136,10 +136,11 @@ gboolean combobox_set_value_from_arrow_key(GtkComboBox *combobox,
                /* if current text is in list, get prev or next one */
 
                if (keyval == GDK_Up) {
-                       const gchar *text = gtk_combo_box_get_active_text(combobox);
+                       gchar *text = gtk_combo_box_get_active_text(combobox);
                        if (!text)
-                               text = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(combobox)));
+                               text = gtk_editable_get_chars(GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(combobox))),0,-1);
                        valid = gtkut_tree_model_text_iter_prev(model, &iter, text);
+                       g_free(text);
                } else
                if (keyval == GDK_Down)
                        valid = gtk_tree_model_iter_next(model, &iter);
index 26b8ebf..2663826 100644 (file)
@@ -279,7 +279,8 @@ static void message_search_execute(gboolean backward)
 
        body_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
        if (!body_str)
-               body_str = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.body_entry)));
+               body_str = gtk_editable_get_chars(
+                               GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.body_entry))),0,-1);
        if (!body_str || *body_str == '\0') return;
 
        /* add to history */
@@ -356,6 +357,7 @@ static void message_search_execute(gboolean backward)
 
        search_window.is_searching = FALSE;
        message_hide_stop_button();
+       g_free(body_str);
 }
 
 static void body_changed(void)
index ba7e788..5bf1b00 100644 (file)
@@ -562,7 +562,8 @@ static void prefs_display_header_list_view_set_row(gboolean hidden)
 
        entry_text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(dispheader.hdr_combo));
        if (!entry_text)
-               entry_text = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(dispheader.hdr_combo)));
+               entry_text = gtk_editable_get_chars(
+                               GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(dispheader.hdr_combo))),0,-1);
        if (!entry_text || entry_text[0] == '\0') {
                alertpanel_error(_("Header name is not set."));
                return;
@@ -588,6 +589,8 @@ static void prefs_display_header_list_view_set_row(gboolean hidden)
                                           dp->name, dp);
 
        prefs_display_header_set_list();
+       
+       g_free(entry_text);
 }
 
 static void prefs_display_header_register_cb(GtkButton *btn,
index 608db48..4abed83 100644 (file)
@@ -525,7 +525,8 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                }
                adv_condition = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.adv_condition_entry));
                if (!adv_condition)
-                       adv_condition = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.adv_condition_entry)));
+                       adv_condition = gtk_editable_get_chars(
+                                       GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.adv_condition_entry))),0,-1);
                if (adv_condition && adv_condition[0] != '\0') {
 
                        /* add to history */
@@ -539,6 +540,7 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        if (!is_fast)
                                interval = 100;
                        /* TODO: check for condition parsing error and show an error dialog */
+                       g_free(adv_condition);
                } else {
                        /* TODO: warn if no search condition? (or make buttons enabled only when
                                at least one search condition has been set */
@@ -564,13 +566,17 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                body_str    = gtk_combo_box_get_active_text(GTK_COMBO_BOX(search_window.body_entry));
 
                if (!from_str)
-                       from_str = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.from_entry)));
+                       from_str = gtk_editable_get_chars(
+                                       GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.from_entry))),0,-1);
                if (!to_str)
-                       to_str = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.to_entry)));
+                       to_str = gtk_editable_get_chars(
+                                       GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.to_entry))),0,-1);
                if (!subject_str)
-                       subject_str = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.subject_entry)));
+                       subject_str = gtk_editable_get_chars(
+                                       GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.subject_entry))),0,-1);
                if (!body_str)
-                       body_str = gtk_entry_get_text(gtk_bin_get_child(GTK_BIN(search_window.body_entry)));
+                       body_str = gtk_editable_get_chars(
+                                       GTK_EDITABLE(gtk_bin_get_child(GTK_BIN(search_window.body_entry))),0,-1);
 
                if (!from_str || !to_str || !subject_str || !body_str) {
                        /* TODO: warn if no search criteria? (or make buttons enabled only when
@@ -783,6 +789,11 @@ static void summary_search_execute(gboolean backward, gboolean search_all)
                        GTK_EVENTS_FLUSH();
        }
 
+       g_free(from_str);
+       g_free(to_str);
+       g_free(subject_str);
+       g_free(body_str);
+
        search_window.is_searching = FALSE;
        summary_hide_stop_button();
        main_window_cursor_normal(summaryview->mainwin);