aboutsummaryrefslogtreecommitdiffstats
path: root/lib/history
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-05 23:57:45 +0800
committerXan Lopez <xan@igalia.com>2012-03-07 04:49:45 +0800
commit9666dba09d79cd88777e9066dbdb2ca5b5e7588f (patch)
tree0ef70074aa9f6bf5875440b6fc371083c9cd47e3 /lib/history
parent222b98ba6644addc080cccbd536d9b90bc27d3ba (diff)
downloadgsoc2013-epiphany-9666dba09d79cd88777e9066dbdb2ca5b5e7588f.tar.gz
gsoc2013-epiphany-9666dba09d79cd88777e9066dbdb2ca5b5e7588f.tar.zst
gsoc2013-epiphany-9666dba09d79cd88777e9066dbdb2ca5b5e7588f.zip
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.
Diffstat (limited to 'lib/history')
-rw-r--r--lib/history/ephy-history-service.c41
-rw-r--r--lib/history/ephy-history-service.h3
2 files changed, 44 insertions, 0 deletions
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 */