check response_id in search_response_cb

This commit is contained in:
Daniel Micay 2012-05-22 04:55:42 -04:00
parent 72aecb23f0
commit a1768c4094
1 changed files with 10 additions and 8 deletions

2
term.c
View File

@ -18,6 +18,7 @@ typedef struct search_dialog_info {
} search_dialog_info; } search_dialog_info;
static void search_response_cb(GtkDialog *dialog, gint response_id, search_dialog_info *info) { static void search_response_cb(GtkDialog *dialog, gint response_id, search_dialog_info *info) {
if (response_id == GTK_RESPONSE_ACCEPT) {
GRegex *regex = vte_terminal_search_get_gregex(VTE_TERMINAL(info->vte)); GRegex *regex = vte_terminal_search_get_gregex(VTE_TERMINAL(info->vte));
if (regex) g_regex_unref(regex); if (regex) g_regex_unref(regex);
regex = g_regex_new(gtk_entry_get_text(GTK_ENTRY(info->entry)), 0, 0, NULL); regex = g_regex_new(gtk_entry_get_text(GTK_ENTRY(info->entry)), 0, 0, NULL);
@ -28,6 +29,7 @@ static void search_response_cb(GtkDialog *dialog, gint response_id, search_dialo
} else { } else {
vte_terminal_search_find_previous(VTE_TERMINAL(info->vte)); vte_terminal_search_find_previous(VTE_TERMINAL(info->vte));
} }
}
free(info); free(info);
gtk_widget_destroy(GTK_WIDGET(dialog)); gtk_widget_destroy(GTK_WIDGET(dialog));