aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filter/ChangeLog5
-rw-r--r--filter/rule-editor.c21
2 files changed, 15 insertions, 11 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 0b3d43930e..1ecb51b9f4 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,5 +1,10 @@
2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
+ * rule-editor.c (cursor_changed): Use an easier method for getting
+ the iter.
+
+2002-12-12 Jeffrey Stedfast <fejj@ximian.com>
+
* vfolder-rule.c (vfolder_editor_sourcelist_new): New custom
function for creating the source_list widget.
(get_widget): Removed the source_list creation code.
diff --git a/filter/rule-editor.c b/filter/rule-editor.c
index 3ea15d9d8b..13b77b72ec 100644
--- a/filter/rule-editor.c
+++ b/filter/rule-editor.c
@@ -506,19 +506,18 @@ set_sensitive (RuleEditor *re)
static void
cursor_changed (GtkTreeView *treeview, RuleEditor *re)
{
- GtkTreeViewColumn *column;
- GtkTreePath *path;
+ GtkTreeSelection *selection;
+ GtkTreeModel *model;
GtkTreeIter iter;
- gtk_tree_view_get_cursor (re->list, &path, &column);
- gtk_tree_model_get_iter (GTK_TREE_MODEL (re->model), &iter, path);
- gtk_tree_path_free (path);
-
- gtk_tree_model_get (GTK_TREE_MODEL (re->model), &iter, 1, &re->current, -1);
-
- g_assert (re->current);
-
- rule_editor_set_sensitive (re);
+ selection = gtk_tree_view_get_selection (re->list);
+ if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+ gtk_tree_model_get (GTK_TREE_MODEL (re->model), &iter, 1, &re->current, -1);
+
+ g_assert (re->current);
+
+ rule_editor_set_sensitive (re);
+ }
}
static void