[rhythmbox] hook up signals for property models correctly on construction



commit 6a157fde3bbae89e0f2ab26d0524916383dd3d17
Author: Jonathan Matthew <jonathan d14n org>
Date:   Fri Feb 22 21:50:58 2013 +1000

    hook up signals for property models correctly on construction
    
    remove the relatively recent change to select the first entry when
    the selected item is removed, as the pre- and post- delete handlers
    make that happen.

 widgets/rb-property-view.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/widgets/rb-property-view.c b/widgets/rb-property-view.c
index a4d6fb4..610cdad 100644
--- a/widgets/rb-property-view.c
+++ b/widgets/rb-property-view.c
@@ -669,12 +669,8 @@ rb_property_view_constructed (GObject *object)
 
        view = RB_PROPERTY_VIEW (object);
 
-       view->priv->prop_model = rhythmdb_property_model_new (view->priv->db, view->priv->propid);
        view->priv->treeview = GTK_WIDGET (gtk_tree_view_new_with_model (GTK_TREE_MODEL 
(view->priv->prop_model)));
 
-       if (view->priv->draggable)
-               rhythmdb_property_model_enable_drag (view->priv->prop_model,
-                                                    GTK_TREE_VIEW (view->priv->treeview));
 
        g_signal_connect_object (G_OBJECT (view->priv->treeview),
                                 "row_activated",
@@ -702,6 +698,11 @@ rb_property_view_constructed (GObject *object)
 
        gtk_container_add (GTK_CONTAINER (view), view->priv->treeview);
 
+       rb_property_view_set_model_internal (view, rhythmdb_property_model_new (view->priv->db, 
view->priv->propid));
+       if (view->priv->draggable)
+               rhythmdb_property_model_enable_drag (view->priv->prop_model,
+                                                    GTK_TREE_VIEW (view->priv->treeview));
+
        gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (view->priv->treeview), TRUE);
        gtk_tree_selection_set_mode (view->priv->selection, GTK_SELECTION_SINGLE);
 
@@ -880,11 +881,6 @@ rb_property_view_selection_changed_cb (GtkTreeSelection *selection,
                                            RHYTHMDB_PROPERTY_MODEL_COLUMN_PRIORITY, &is_all, -1);
                        g_signal_emit (G_OBJECT (view), rb_property_view_signals[PROPERTY_SELECTED], 0,
                                       is_all ? NULL : selected_prop);
-               } else {
-                       if (gtk_tree_model_get_iter_first (model, &iter))
-                               gtk_tree_selection_select_iter (selection, &iter);
-                       g_signal_emit (G_OBJECT (view), rb_property_view_signals[PROPERTY_SELECTED], 0,
-                                      NULL);
                }
        }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]