summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-08-12 19:44:48 +0300
committerClaudio Saavedra <csaavedra@igalia.com>2012-08-12 19:44:48 +0300
commit5dc2c50b265d5618e11f1c9011773eea6abaaa22 (patch)
treedc9ac7fe49e3b0dc529a8cdd18f8233331075455
parent0bdf50949dcfa241bd49c15d719107baa4010d49 (diff)
downloadepiphany-5dc2c50b265d5618e11f1c9011773eea6abaaa22.tar.gz
ephy-frecent-store: add a method to mark a row as hidden
-rw-r--r--src/ephy-frecent-store.c34
-rw-r--r--src/ephy-frecent-store.h5
2 files changed, 38 insertions, 1 deletions
diff --git a/src/ephy-frecent-store.c b/src/ephy-frecent-store.c
index 4ef499393..80ffe62ad 100644
--- a/src/ephy-frecent-store.c
+++ b/src/ephy-frecent-store.c
@@ -270,3 +270,37 @@ ephy_frecent_store_new (void)
return g_object_new (EPHY_TYPE_FRECENT_STORE,
NULL);
}
+
+static void
+set_url_hidden_cb (EphyHistoryService *service,
+ gboolean success,
+ gpointer result_data,
+ EphyFrecentStore *store)
+{
+ if (!success)
+ return;
+
+ ephy_frecent_store_fetch_urls (store, service);
+}
+
+void
+ephy_frecent_store_set_hidden (EphyFrecentStore *store,
+ GtkTreeIter *iter)
+{
+ EphyHistoryService *service;
+ char *uri;
+
+ g_return_if_fail (EPHY_IS_FRECENT_STORE (store));
+ g_return_if_fail (iter != NULL);
+
+ gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+ EPHY_OVERVIEW_STORE_URI, &uri,
+ -1);
+ g_object_get (store, "history-service", &service, NULL);
+
+ ephy_history_service_set_url_hidden (service,
+ uri, TRUE, NULL,
+ (EphyHistoryJobCallback) set_url_hidden_cb,
+ store);
+ g_free (uri);
+}
diff --git a/src/ephy-frecent-store.h b/src/ephy-frecent-store.h
index cbdb08ca5..16e4ef684 100644
--- a/src/ephy-frecent-store.h
+++ b/src/ephy-frecent-store.h
@@ -51,7 +51,10 @@ struct _EphyFrecentStoreClass
GType ephy_frecent_store_get_type (void) G_GNUC_CONST;
-EphyFrecentStore* ephy_frecent_store_new (void);
+EphyFrecentStore* ephy_frecent_store_new (void);
+
+void ephy_frecent_store_set_hidden (EphyFrecentStore *store,
+ GtkTreeIter *iter);
G_END_DECLS