[epiphany/history-rewrite-second] Allow the visits and urls queries to be host-specific
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/history-rewrite-second] Allow the visits and urls queries to be host-specific
- Date: Fri, 2 Mar 2012 19:44:09 +0000 (UTC)
commit 168e953bd345a6f6bdcb0c2248bd4869abc3f839
Author: Claudio Saavedra <csaavedra igalia com>
Date: Fri Mar 2 21:20:27 2012 +0200
Allow the visits and urls queries to be host-specific
lib/history/ephy-history-service-urls-table.c | 11 +++++++++++
lib/history/ephy-history-service-visits-table.c | 11 +++++++++++
2 files changed, 22 insertions(+), 0 deletions(-)
---
diff --git a/lib/history/ephy-history-service-urls-table.c b/lib/history/ephy-history-service-urls-table.c
index 5473894..75d98ea 100644
--- a/lib/history/ephy-history-service-urls-table.c
+++ b/lib/history/ephy-history-service-urls-table.c
@@ -252,6 +252,9 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *
statement_str = g_string_append (statement_str, "WHERE ");
}
+ if (query->host > 0)
+ statement_str = g_string_append (statement_str, "urls.host = ? AND ");
+
for (substring = query->substring_list; substring != NULL; substring = substring->next)
statement_str = g_string_append (statement_str, "(urls.url LIKE ? OR urls.title LIKE ?) AND ");
@@ -298,6 +301,14 @@ ephy_history_service_find_url_rows (EphyHistoryService *self, EphyHistoryQuery *
return NULL;
}
}
+ if (query->host > 0) {
+ if (ephy_sqlite_statement_bind_int (statement, i++, (int)query->host, &error) == FALSE) {
+ g_error ("Could not build urls table query statement: %s", error->message);
+ g_error_free (error);
+ g_object_unref (statement);
+ return NULL;
+ }
+ }
for (substring = query->substring_list; substring != NULL; substring = substring->next) {
char *string = g_strdup_printf ("%%%s%%", (char*)substring->data);
if (ephy_sqlite_statement_bind_string (statement, i++, string, &error) == FALSE) {
diff --git a/lib/history/ephy-history-service-visits-table.c b/lib/history/ephy-history-service-visits-table.c
index 822a336..b14aa42 100644
--- a/lib/history/ephy-history-service-visits-table.c
+++ b/lib/history/ephy-history-service-visits-table.c
@@ -138,6 +138,9 @@ ephy_history_service_find_visit_rows (EphyHistoryService *self, EphyHistoryQuery
if (query->to >= 0)
statement_str = g_string_append (statement_str, "visits.visit_time <= ? AND ");
+ if (query->host > 0)
+ statement_str = g_string_append (statement_str, "urls.host = ? AND ");
+
for (substring = query->substring_list; substring != NULL; substring = substring->next) {
statement_str = g_string_append (statement_str, "(urls.url LIKE ? OR urls.title LIKE ?) AND ");
}
@@ -170,6 +173,14 @@ ephy_history_service_find_visit_rows (EphyHistoryService *self, EphyHistoryQuery
return NULL;
}
}
+ if (query->host > 0) {
+ if (ephy_sqlite_statement_bind_int (statement, i++, (int)query->host, &error) == FALSE) {
+ g_error ("Could not build urls table query statement: %s", error->message);
+ g_error_free (error);
+ g_object_unref (statement);
+ return NULL;
+ }
+ }
for (substring = query->substring_list; substring != NULL; substring = substring->next) {
char *string = g_strdup_printf ("%%%s%%", (char*)substring->data);
if (ephy_sqlite_statement_bind_string (statement, i++, string, &error) == FALSE) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]