[epiphany/history-rewrite] ephy-history-service: add the public API to remove a list of urls from the history



commit d6c4808b20cdc18c5d94ee0d50098bc6148a116a
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Thu Jul 21 12:33:13 2011 +0300

    ephy-history-service: add the public API to remove a list of urls from the history

 lib/history/ephy-history-service.c |   33 +++++++++++++++++++++++++++++++++
 lib/history/ephy-history-service.h |    1 +
 2 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index d60c347..aa12fa7 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -733,3 +733,36 @@ ephy_history_service_set_url_property (EphyHistoryService *self,
                                       ephy_history_service_execute_job_on_history_thread,
                                       details);
 }
+
+static gboolean
+ephy_history_service_execute_delete_urls (EphyHistoryService *self,
+                                          GList *urls,
+                                          gpointer *result)
+{
+  GList *l;
+  EphyHistoryURL *url;
+
+  for (l = urls; l != NULL; l = l->next) {
+    url = l->data;
+    ephy_history_service_delete_url (self, url);
+  }
+  ephy_history_service_schedule_commit (self);
+
+  return TRUE;
+}
+
+void
+ephy_history_service_delete_urls (EphyHistoryService *self,
+                                  GList *urls,
+                                  EphyHistoryJobCallback callback,
+                                  gpointer user_data)
+{
+  EphyHistoryThreadJobDetails *details =
+    ephy_history_thread_job_details_new (self,
+                                         (EphyHistoryJobMethod) ephy_history_service_execute_delete_urls,
+                                         ephy_history_url_list_copy (urls), (GDestroyNotify)ephy_history_url_list_free,
+                                         callback, user_data);
+  ephy_history_service_schedule_idle (self, G_PRIORITY_DEFAULT,
+                                      ephy_history_service_execute_job_on_history_thread,
+                                      details);
+}
diff --git a/lib/history/ephy-history-service.h b/lib/history/ephy-history-service.h
index efaeb6f..601d13b 100644
--- a/lib/history/ephy-history-service.h
+++ b/lib/history/ephy-history-service.h
@@ -63,6 +63,7 @@ void                     ephy_history_service_set_url_title           (EphyHisto
 void                     ephy_history_service_set_url_zoom_level      (EphyHistoryService *self, const char *url, const double zoom_level, EphyHistoryJobCallback callback, gpointer user_data);
 void                     ephy_history_service_set_url_property        (EphyHistoryService *self, const char *url, EphyHistoryURLProperty property, GVariant *value, EphyHistoryJobCallback callback, gpointer user_data);
 void                     ephy_history_service_get_url                 (EphyHistoryService *self, const char *url, EphyHistoryJobCallback callback, gpointer user_data);
+void                     ephy_history_service_delete_urls             (EphyHistoryService *self, GList *urls, EphyHistoryJobCallback callback, gpointer user_data);
 G_END_DECLS
 
 #endif /* EPHY_HISTORY_SERVICE_H */



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