From 9666dba09d79cd88777e9066dbdb2ca5b5e7588f Mon Sep 17 00:00:00 2001 From: Xan Lopez Date: Mon, 5 Mar 2012 16:57:45 +0100 Subject: Get rid of EphyBrowseHistory It was a very thin wrapper on top of the history service, it does not seem to make much sense. For now move the two useful helper methods down to the service without further changes. --- lib/history/ephy-history-service.c | 41 ++++++++++++++++++++++++++++++++++++++ lib/history/ephy-history-service.h | 3 +++ 2 files changed, 44 insertions(+) (limited to 'lib') diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c index 6261a4333..b8bd2c26b 100644 --- a/lib/history/ephy-history-service.c +++ b/lib/history/ephy-history-service.c @@ -709,3 +709,44 @@ ephy_history_service_process_message (EphyHistoryService *self, return; } + +/* Public API. */ + +void +ephy_history_service_find_urls (EphyHistoryService *self, + gint64 from, gint64 to, + guint limit, + GList *substring_list, + EphyHistoryJobCallback callback, + gpointer user_data) +{ + EphyHistoryQuery *query; + + g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self)); + + query = ephy_history_query_new (); + query->from = from; + query->to = to; + query->substring_list = substring_list; + query->sort_type = EPHY_HISTORY_SORT_MV; + + if (limit != 0) + query->limit = limit; + + ephy_history_service_query_urls (self, + query, callback, user_data); +} + +void +ephy_history_service_add_page (EphyHistoryService *self, + const char *url) +{ + EphyHistoryPageVisit *visit; + + visit = ephy_history_page_visit_new (url, + time (NULL), + EPHY_PAGE_VISIT_TYPED); + ephy_history_service_add_visit (self, + visit, NULL, NULL); + ephy_history_page_visit_free (visit); +} diff --git a/lib/history/ephy-history-service.h b/lib/history/ephy-history-service.h index b01dd076f..049b3cdf5 100644 --- a/lib/history/ephy-history-service.h +++ b/lib/history/ephy-history-service.h @@ -64,6 +64,9 @@ void ephy_history_service_set_url_zoom_level (EphyHisto void ephy_history_service_get_host_for_url (EphyHistoryService *self, const char *url, 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); +void ephy_history_service_find_urls (EphyHistoryService *self, gint64 from, gint64 to, guint limit, GList *substring_list, EphyHistoryJobCallback callback, gpointer user_data); +void ephy_history_service_add_page (EphyHistoryService *self, const char *orig_url); + G_END_DECLS #endif /* EPHY_HISTORY_SERVICE_H */ -- cgit v1.2.3