diff options
author | Claudio Saavedra <csaavedra@igalia.com> | 2012-08-27 16:33:43 +0800 |
---|---|---|
committer | Claudio Saavedra <csaavedra@igalia.com> | 2012-09-01 02:34:01 +0800 |
commit | affeb74c66da52079ff49f148f4220ad8b52515f (patch) | |
tree | 77c499126bf4eb004171f3b14f36e1d7d3690816 | |
parent | 54edad24dc20d71b9c4e3056533dd8ee6a10e03e (diff) | |
download | gsoc2013-epiphany-affeb74c66da52079ff49f148f4220ad8b52515f.tar.gz gsoc2013-epiphany-affeb74c66da52079ff49f148f4220ad8b52515f.tar.zst gsoc2013-epiphany-affeb74c66da52079ff49f148f4220ad8b52515f.zip |
ephy-history-service: add API to store a url's thumbnail update time
-rw-r--r-- | lib/history/ephy-history-service.c | 43 | ||||
-rw-r--r-- | lib/history/ephy-history-service.h | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c index 8fa76ad7c..ffe302b22 100644 --- a/lib/history/ephy-history-service.c +++ b/lib/history/ephy-history-service.c @@ -31,6 +31,7 @@ typedef enum { SET_URL_TITLE, SET_URL_ZOOM_LEVEL, SET_URL_HIDDEN, + SET_URL_THUMBNAIL_TIME, ADD_VISIT, ADD_VISITS, DELETE_URLS, @@ -840,6 +841,47 @@ ephy_history_service_set_url_hidden (EphyHistoryService *self, } static gboolean +ephy_history_service_execute_set_url_thumbnail_time (EphyHistoryService *self, + EphyHistoryURL *url, + gpointer *result) +{ + int thumbnail_time; + + thumbnail_time = url->thumbnail_time; + + if (NULL == ephy_history_service_get_url_row (self, NULL, url)) + return FALSE; + else { + url->thumbnail_time = thumbnail_time; + ephy_history_service_update_url_row (self, url); + ephy_history_service_schedule_commit (self); + return TRUE; + } +} + +void +ephy_history_service_set_url_thumbnail_time (EphyHistoryService *self, + const char *orig_url, + int thumbnail_time, + GCancellable *cancellable, + EphyHistoryJobCallback callback, + gpointer user_data) +{ + EphyHistoryURL *url; + EphyHistoryServiceMessage *message; + + g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self)); + g_return_if_fail (orig_url != NULL); + + url = ephy_history_url_new (orig_url, NULL, 0, 0, 0); + url->thumbnail_time = thumbnail_time; + message = ephy_history_service_message_new (self, SET_URL_THUMBNAIL_TIME, + url, (GDestroyNotify) ephy_history_url_free, + cancellable, callback, user_data); + ephy_history_service_send_message (self, message); +} + +static gboolean ephy_history_service_execute_get_url (EphyHistoryService *self, const gchar *orig_url, gpointer *result) @@ -1013,6 +1055,7 @@ static EphyHistoryServiceMethod methods[] = { (EphyHistoryServiceMethod)ephy_history_service_execute_set_url_title, (EphyHistoryServiceMethod)ephy_history_service_execute_set_url_zoom_level, (EphyHistoryServiceMethod)ephy_history_service_execute_set_url_hidden, + (EphyHistoryServiceMethod)ephy_history_service_execute_set_url_thumbnail_time, (EphyHistoryServiceMethod)ephy_history_service_execute_add_visit, (EphyHistoryServiceMethod)ephy_history_service_execute_add_visits, (EphyHistoryServiceMethod)ephy_history_service_execute_delete_urls, diff --git a/lib/history/ephy-history-service.h b/lib/history/ephy-history-service.h index f8d64d852..d6db3a51f 100644 --- a/lib/history/ephy-history-service.h +++ b/lib/history/ephy-history-service.h @@ -67,6 +67,7 @@ void ephy_history_service_query_visits (EphyHisto void ephy_history_service_query_urls (EphyHistoryService *self, EphyHistoryQuery *query, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_set_url_title (EphyHistoryService *self, const char *url, const char *title, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_set_url_hidden (EphyHistoryService *self, const char *url, gboolean hidden, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); +void ephy_history_service_set_url_thumbnail_time (EphyHistoryService *self, const char *orig_url, int thumbnail_time, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_set_url_zoom_level (EphyHistoryService *self, const char *url, const double zoom_level, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_get_host_for_url (EphyHistoryService *self, const char *url, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); void ephy_history_service_get_hosts (EphyHistoryService *self, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data); |