[epiphany/overview] ephy-overview: mark frecent pages as hidden on "item-deleted"



commit 256536f035c916a0c037cc0eba48f2daa9a17440
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Sun Aug 12 19:46:42 2012 +0300

    ephy-overview: mark frecent pages as hidden on "item-deleted"
    
    For now, there is no way to undo this, but we'll eventually add it

 src/ephy-overview.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-overview.c b/src/ephy-overview.c
index 4988e6d..8173f598 100644
--- a/src/ephy-overview.c
+++ b/src/ephy-overview.c
@@ -112,6 +112,24 @@ active_view_item_deleted (GtkWidget *widget,
   return TRUE;
 }
 
+static gboolean
+frecent_view_item_deleted (GtkWidget *widget,
+                           gchar *path,
+                           gpointer data)
+{
+  EphyFrecentStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *tree_path;
+
+  store = EPHY_FRECENT_STORE (gd_main_view_get_model (GD_MAIN_VIEW (widget)));
+  tree_path = gtk_tree_path_new_from_string (path);
+  gtk_tree_model_get_iter (GTK_TREE_MODEL (store), &iter, tree_path);
+  ephy_frecent_store_set_hidden (store, &iter);
+  gtk_tree_path_free (tree_path);
+
+  return TRUE;
+}
+
 static void
 main_view_item_activated (GtkWidget *widget,
                           gchar *id,
@@ -186,7 +204,7 @@ ephy_overview_constructed (GObject *object)
   g_signal_connect (self->priv->frecent_view, "item-activated",
                     G_CALLBACK (main_view_item_activated), self->priv->parent_window);
   g_signal_connect (self->priv->frecent_view, "item-deleted",
-                    G_CALLBACK (gtk_true), NULL);
+                    G_CALLBACK (frecent_view_item_deleted), NULL);
 
   store = EPHY_OVERVIEW_STORE (ephy_frecent_store_new ());
   g_object_set (G_OBJECT (store),



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