summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/bookmark_editor_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/bookmark_editor_gtk.cc')
-rw-r--r--chrome/browser/gtk/bookmark_editor_gtk.cc16
1 files changed, 11 insertions, 5 deletions
diff --git a/chrome/browser/gtk/bookmark_editor_gtk.cc b/chrome/browser/gtk/bookmark_editor_gtk.cc
index f4da66e..7f5ed6f 100644
--- a/chrome/browser/gtk/bookmark_editor_gtk.cc
+++ b/chrome/browser/gtk/bookmark_editor_gtk.cc
@@ -183,14 +183,20 @@ void BookmarkEditorGtk::Init(GtkWindow* parent_window) {
tree_selection_ = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree_view_));
+ GtkTreePath* path = NULL;
if (selected_id) {
- GtkTreePath* path = gtk_tree_model_get_path(GTK_TREE_MODEL(tree_store_),
- &selected_iter);
- gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path);
- gtk_tree_selection_select_path(tree_selection_, path);
- gtk_tree_path_free(path);
+ path = gtk_tree_model_get_path(GTK_TREE_MODEL(tree_store_),
+ &selected_iter);
+ } else {
+ // We don't have a selected parent (Probably because we're making a new
+ // bookmark). Select the first item in the list.
+ path = gtk_tree_path_new_from_string("0");
}
+ gtk_tree_view_expand_to_path(GTK_TREE_VIEW(tree_view_), path);
+ gtk_tree_selection_select_path(tree_selection_, path);
+ gtk_tree_path_free(path);
+
GtkWidget* scroll_window = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_window),
GTK_POLICY_NEVER,