diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-03-06 23:08:50 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-07 04:49:47 +0800 |
commit | e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1 (patch) | |
tree | 17a61a1744446a4b5af683a722e5ab82ec807043 /lib/history/ephy-history-service.c | |
parent | fd23fbade3ef2c5490f6d3e7f0a7de7c39872fff (diff) | |
download | gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar.gz gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar.bz2 gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar.lz gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar.xz gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.tar.zst gsoc2013-epiphany-e9463a9dc1fd77f741d3cc6a6c335db9733ebdf1.zip |
ephy-history-service: add a method to remove a host from the history
This method will remove all the history related to that host.
Diffstat (limited to 'lib/history/ephy-history-service.c')
-rw-r--r-- | lib/history/ephy-history-service.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c index 53363bc56..4c9e44179 100644 --- a/lib/history/ephy-history-service.c +++ b/lib/history/ephy-history-service.c @@ -32,6 +32,7 @@ typedef enum { ADD_VISIT, ADD_VISITS, DELETE_URLS, + DELETE_HOST, CLEAR, /* QUIT */ QUIT, @@ -756,6 +757,18 @@ ephy_history_service_execute_delete_urls (EphyHistoryService *self, } static gboolean +ephy_history_service_execute_delete_host (EphyHistoryService *self, + EphyHistoryHost *host, + EphyHistoryJobCallback callback, + gpointer user_data) +{ + ephy_history_service_delete_host_row (self, host); + ephy_history_service_schedule_commit (self); + + return TRUE; +} + +static gboolean ephy_history_service_execute_clear (EphyHistoryService *self, gpointer pointer, gpointer *result) @@ -781,6 +794,19 @@ ephy_history_service_delete_urls (EphyHistoryService *self, } void +ephy_history_service_delete_host (EphyHistoryService *self, + EphyHistoryHost *host, + EphyHistoryJobCallback callback, + gpointer user_data) +{ + EphyHistoryServiceMessage *message = + ephy_history_service_message_new (self, DELETE_HOST, + ephy_history_host_copy (host), (GDestroyNotify)ephy_history_host_free, + callback, user_data); + ephy_history_service_send_message (self, message); +} + +void ephy_history_service_clear (EphyHistoryService *self, EphyHistoryJobCallback callback, gpointer user_data) @@ -810,6 +836,7 @@ static EphyHistoryServiceMethod methods[] = { (EphyHistoryServiceMethod)ephy_history_service_execute_add_visit, (EphyHistoryServiceMethod)ephy_history_service_execute_add_visits, (EphyHistoryServiceMethod)ephy_history_service_execute_delete_urls, + (EphyHistoryServiceMethod)ephy_history_service_execute_delete_host, (EphyHistoryServiceMethod)ephy_history_service_execute_clear, (EphyHistoryServiceMethod)ephy_history_service_execute_quit, (EphyHistoryServiceMethod)ephy_history_service_execute_get_url, |