[epiphany/wip/history-rewrite: 9/9] Add ephy_history_service_get_hosts()
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/history-rewrite: 9/9] Add ephy_history_service_get_hosts()
- Date: Tue, 6 Mar 2012 09:10:42 +0000 (UTC)
commit ec1ca310d6050ecce00e645e6a7bfeb095eb0bd4
Author: Claudio Saavedra <csaavedra igalia com>
Date: Mon Mar 5 18:41:23 2012 +0200
Add ephy_history_service_get_hosts()
To retrieve all hosts in the history
lib/history/ephy-history-service.c | 29 ++++++++++++++++++++++++++++-
lib/history/ephy-history-service.h | 1 +
2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index 5772885..8e167df 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -41,6 +41,7 @@ typedef enum {
QUERY_URLS,
QUERY_VISITS,
POPULATE_HOSTS,
+ GET_HOSTS
} EphyHistoryServiceMessageType;
enum {
@@ -528,6 +529,18 @@ ephy_history_service_execute_populate_hosts (EphyHistoryService *self,
return TRUE;
}
+static gboolean
+ephy_history_service_execute_get_hosts (EphyHistoryService *self,
+ gpointer pointer, gpointer *results)
+{
+ GList *hosts;
+
+ hosts = ephy_history_service_get_all_hosts (self);
+ *results = hosts;
+
+ return hosts != NULL;
+}
+
void
ephy_history_service_add_visit (EphyHistoryService *self, EphyHistoryPageVisit *visit, EphyHistoryJobCallback callback, gpointer user_data)
{
@@ -605,6 +618,19 @@ ephy_history_service_populate_hosts (EphyHistoryService *self,
ephy_history_service_send_message (self, message);
}
+void
+ephy_history_service_get_hosts (EphyHistoryService *self,
+ EphyHistoryJobCallback callback,
+ gpointer user_data)
+{
+ EphyHistoryServiceMessage *message;
+
+ message = ephy_history_service_message_new (self, GET_HOSTS,
+ NULL, NULL,
+ callback, user_data);
+ ephy_history_service_send_message (self, message);
+}
+
static gboolean
ephy_history_service_execute_set_url_title (EphyHistoryService *self,
EphyHistoryURL *url,
@@ -814,7 +840,8 @@ static EphyHistoryServiceMethod methods[] = {
(EphyHistoryServiceMethod)ephy_history_service_execute_get_host_for_url,
(EphyHistoryServiceMethod)ephy_history_service_execute_query_urls,
(EphyHistoryServiceMethod)ephy_history_service_execute_find_visits,
- (EphyHistoryServiceMethod)ephy_history_service_execute_populate_hosts
+ (EphyHistoryServiceMethod)ephy_history_service_execute_populate_hosts,
+ (EphyHistoryServiceMethod)ephy_history_service_execute_get_hosts
};
static void
diff --git a/lib/history/ephy-history-service.h b/lib/history/ephy-history-service.h
index 1fe5740..927e324 100644
--- a/lib/history/ephy-history-service.h
+++ b/lib/history/ephy-history-service.h
@@ -66,6 +66,7 @@ void ephy_history_service_query_urls (EphyHisto
void ephy_history_service_set_url_title (EphyHistoryService *self, const char *url, const char *title, EphyHistoryJobCallback callback, gpointer user_data);
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_get_host_for_url (EphyHistoryService *self, const char *url, EphyHistoryJobCallback callback, gpointer user_data);
+void ephy_history_service_get_hosts (EphyHistoryService *self, EphyHistoryJobCallback callback, gpointer user_data);
void ephy_history_service_populate_hosts (EphyHistoryService *self, GList *hosts, 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]