[gnome-documents] main-view: pass the GtkTreePath in addition to the id when activating



commit cb1a9dbbe8846fd67387f001664ed0b18d6995ff
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Dec 14 18:57:47 2011 +0100

    main-view: pass the GtkTreePath in addition to the id when activating

 src/lib/gd-main-view.c |   11 +++++++----
 src/view.js            |    2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/src/lib/gd-main-view.c b/src/lib/gd-main-view.c
index 055a764..8d6e39b 100644
--- a/src/lib/gd-main-view.c
+++ b/src/lib/gd-main-view.c
@@ -158,8 +158,9 @@ gd_main_view_class_init (GdMainViewClass *klass)
                   GD_TYPE_MAIN_VIEW,
                   G_SIGNAL_RUN_LAST,
                   0, NULL, NULL, NULL,
-                  G_TYPE_NONE, 1,
-                  G_TYPE_STRING);
+                  G_TYPE_NONE, 2,
+                  G_TYPE_STRING, 
+                  GTK_TYPE_TREE_PATH);
 
   signals[SELECTION_MODE_REQUEST] =
     g_signal_new ("selection-mode-request",
@@ -211,12 +212,14 @@ on_button_release_view_mode (GdMainView *self,
   if (self->priv->model == NULL)
     return FALSE;
 
-  gtk_tree_model_get_iter (self->priv->model, &iter, path);
+  if (!gtk_tree_model_get_iter (self->priv->model, &iter, path))
+    return FALSE;
+
   gtk_tree_model_get (self->priv->model, &iter,
                       GD_MAIN_COLUMN_ID, &id,
                       -1);
 
-  g_signal_emit (self, signals[ITEM_ACTIVATED], 0, id);
+  g_signal_emit (self, signals[ITEM_ACTIVATED], 0, id, path);
   g_free (id);
 
   return TRUE;
diff --git a/src/view.js b/src/view.js
index d7709da..4e419de 100644
--- a/src/view.js
+++ b/src/view.js
@@ -196,7 +196,7 @@ View.prototype = {
         Global.selectionController.setSelectionMode(true);
     },
 
-    _onItemActivated: function(widget, id) {
+    _onItemActivated: function(widget, id, path) {
         Global.documentManager.setActiveItemById(id);
     },
 



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