diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-16 16:16:48 +0100 |
---|---|---|
committer | Denys Vlasenko <dvlasenk@redhat.com> | 2011-02-16 16:16:48 +0100 |
commit | 6954cd68d9fe36277c528b92f2cff44fdeea68be (patch) | |
tree | c90b20e0fc9315c0fa0d427f80189f791e41dbcb | |
parent | 3d930bb468cb0613098f417e6f011e366414157c (diff) | |
download | abrt-6954cd68d9fe36277c528b92f2cff44fdeea68be.tar.gz abrt-6954cd68d9fe36277c528b92f2cff44fdeea68be.tar.xz abrt-6954cd68d9fe36277c528b92f2cff44fdeea68be.zip |
abrt-gtk: trivial simplification
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
-rw-r--r-- | src/gui-gtk/abrt-gtk.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gui-gtk/abrt-gtk.c b/src/gui-gtk/abrt-gtk.c index c72f0043..be90883f 100644 --- a/src/gui-gtk/abrt-gtk.c +++ b/src/gui-gtk/abrt-gtk.c @@ -237,7 +237,6 @@ void sanitize_cursor(GtkTreePath *preferred_path) if (path) { /* Cursor exists already */ - gtk_tree_path_free(path); goto ret; } @@ -251,7 +250,6 @@ void sanitize_cursor(GtkTreePath *preferred_path) gtk_tree_view_get_cursor(GTK_TREE_VIEW(s_treeview), &path, /* GtkTreeViewColumn** */ NULL); if (path) /* yes */ { - gtk_tree_path_free(path); goto ret; } } @@ -261,14 +259,19 @@ void sanitize_cursor(GtkTreePath *preferred_path) if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(s_dumps_list_store), &iter)) { /* We have at least one element, put cursor on it */ + + /* Get path from iter pointing to 1st element */ path = gtk_tree_model_get_path(GTK_TREE_MODEL(s_dumps_list_store), &iter); + + /* Use it to set cursor */ gtk_tree_view_set_cursor(GTK_TREE_VIEW(s_treeview), path, /* GtkTreeViewColumn *focus_column */ NULL, /* start_editing */ false); - gtk_tree_path_free(path); } /* else we have no elements */ ret: + gtk_tree_path_free(path); + /* Without this, the *header* of the list gets the focus. Ugly. */ gtk_widget_grab_focus(s_treeview); } |