diff options
author | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-06-02 21:35:22 +0000 |
---|---|---|
committer | stig <stig@f5534014-38df-0310-8fa8-9805f1628bb7> | 2008-06-02 21:35:22 +0000 |
commit | b9bd17dbfc327a5fabbea717a851b48c440a858b (patch) | |
tree | b5c4decc533c6077f3efb5cd517b5b994f34467f /gtk/prefs_capture.c | |
parent | 99419c771ef326d5f07b358acf8677f7677a9a8f (diff) |
Rewrote to not use gtk_combo_box_get_active_text().
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25412 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/prefs_capture.c')
-rw-r--r-- | gtk/prefs_capture.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gtk/prefs_capture.c b/gtk/prefs_capture.c index c54dc30f7d..34c7a75f21 100644 --- a/gtk/prefs_capture.c +++ b/gtk/prefs_capture.c @@ -458,7 +458,7 @@ ifopts_edit_destroy_cb(GtkWidget *win, gpointer data _U_) } } -static int +static gint ifopts_description_to_val (const char *if_name, const char *descr) { data_link_info_t *data_link_info; @@ -570,7 +570,9 @@ static void ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata) { gchar *ifnm, *text; - int linktype; + gint linktype; + GtkTreeModel *model; + GtkTreeIter iter; if (ifrow == IFOPTS_IF_NOSEL) return; @@ -581,12 +583,13 @@ ifopts_edit_linktype_changed_cb(GtkComboBox *cb, gpointer udata) gtk_clist_get_text(GTK_CLIST(udata), ifrow, 0, &ifnm); /* get current description text and set value in current CList */ - text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(cb)); - gtk_clist_set_text(GTK_CLIST(udata), ifrow, 2, text); - linktype = ifopts_description_to_val(ifnm, text); - gtk_clist_set_row_data(GTK_CLIST(udata), ifrow, GINT_TO_POINTER(linktype)); - - g_free(text); + if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(cb), &iter)) { + model = gtk_combo_box_get_model(GTK_COMBO_BOX(cb)); + gtk_tree_model_get(model, &iter, 0, &text, -1); + gtk_clist_set_text(GTK_CLIST(udata), ifrow, 2, text); + linktype = ifopts_description_to_val(ifnm, text); + gtk_clist_set_row_data(GTK_CLIST(udata), ifrow, GINT_TO_POINTER(linktype)); + } } /* |