aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-14 01:57:56 +0800
committerXan Lopez <xan@igalia.com>2012-03-14 19:45:03 +0800
commitd42586bb4a2fb45cad1fcc2cf7f6b49a423770cd (patch)
treed20150e82405b42d4a78c9fc44eb42d9f38edca4 /lib
parentc07e7d034b4cfdaad4fc35ef5e82bee9718a1bd9 (diff)
downloadgsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.gz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.bz2
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.lz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.xz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.zst
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.zip
history: remember visit types
Instead of hardcoding all visits as 'TYPED' properly distinguish between bookmarks, following links and typing URIs in the entry. We'll use this to compute the frecency of history items.
Diffstat (limited to 'lib')
-rw-r--r--lib/history/ephy-history-service.c15
-rw-r--r--lib/history/ephy-history-service.h5
-rw-r--r--lib/history/ephy-history-types.h3
3 files changed, 15 insertions, 8 deletions
diff --git a/lib/history/ephy-history-service.c b/lib/history/ephy-history-service.c
index f7b468b9e..d618547e5 100644
--- a/lib/history/ephy-history-service.c
+++ b/lib/history/ephy-history-service.c
@@ -21,6 +21,7 @@
#include "ephy-history-service-private.h"
#include "ephy-history-types.h"
+#include "ephy-history-type-builtins.h"
#include "ephy-sqlite-connection.h"
typedef gboolean (*EphyHistoryServiceMethod) (EphyHistoryService *self, gpointer data, gpointer *result);
@@ -125,13 +126,13 @@ ephy_history_service_finalize (GObject *self)
}
static gboolean
-impl_visit_url (EphyHistoryService *self, const char *url)
+impl_visit_url (EphyHistoryService *self, const char *url, EphyHistoryPageVisitType visit_type)
{
EphyHistoryPageVisit *visit;
visit = ephy_history_page_visit_new (url,
time (NULL),
- EPHY_PAGE_VISIT_TYPED);
+ visit_type);
ephy_history_service_add_visit (self,
visit, NULL, NULL, NULL);
ephy_history_page_visit_free (visit);
@@ -158,8 +159,9 @@ ephy_history_service_class_init (EphyHistoryServiceClass *klass)
g_signal_accumulator_true_handled, NULL,
g_cclosure_marshal_generic,
G_TYPE_BOOLEAN,
- 1,
- G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE);
+ 2,
+ G_TYPE_STRING | G_SIGNAL_TYPE_STATIC_SCOPE,
+ EPHY_TYPE_HISTORY_PAGE_VISIT_TYPE);
signals[CLEARED] =
g_signal_new ("cleared",
@@ -1008,14 +1010,15 @@ ephy_history_service_find_urls (EphyHistoryService *self,
void
ephy_history_service_visit_url (EphyHistoryService *self,
- const char *url)
+ const char *url,
+ EphyHistoryPageVisitType visit_type)
{
gboolean result;
g_return_if_fail (EPHY_IS_HISTORY_SERVICE (self));
g_return_if_fail (url != NULL);
- g_signal_emit (self, signals[VISIT_URL], 0, url, &result);
+ g_signal_emit (self, signals[VISIT_URL], 0, url, visit_type, &result);
}
void
diff --git a/lib/history/ephy-history-service.h b/lib/history/ephy-history-service.h
index c2e2093db..233f443bf 100644
--- a/lib/history/ephy-history-service.h
+++ b/lib/history/ephy-history-service.h
@@ -53,7 +53,8 @@ struct _EphyHistoryServiceClass {
/* Signals */
gboolean (* visit_url) (EphyHistoryService *self,
- const char *url);
+ const char *url,
+ EphyHistoryPageVisitType visit_type);
};
GType ephy_history_service_get_type (void);
@@ -73,7 +74,7 @@ void ephy_history_service_delete_host (EphyHisto
void ephy_history_service_get_url (EphyHistoryService *self, const char *url, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data);
void ephy_history_service_delete_urls (EphyHistoryService *self, GList *urls, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data);
void ephy_history_service_find_urls (EphyHistoryService *self, gint64 from, gint64 to, guint limit, gint host, GList *substring_list, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data);
-void ephy_history_service_visit_url (EphyHistoryService *self, const char *orig_url);
+void ephy_history_service_visit_url (EphyHistoryService *self, const char *orig_url, EphyHistoryPageVisitType visit_type);
void ephy_history_service_clear (EphyHistoryService *self, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data);
void ephy_history_service_find_hosts (EphyHistoryService *self, gint64 from, gint64 to, GCancellable *cancellable, EphyHistoryJobCallback callback, gpointer user_data);
diff --git a/lib/history/ephy-history-types.h b/lib/history/ephy-history-types.h
index 4ff836fc6..28e762d4e 100644
--- a/lib/history/ephy-history-types.h
+++ b/lib/history/ephy-history-types.h
@@ -30,6 +30,7 @@ G_BEGIN_DECLS
* src/chrome/common/page_transition_types.h in the Chromium source code.
*/
typedef enum {
+ EPHY_PAGE_VISIT_NONE,
EPHY_PAGE_VISIT_LINK,
EPHY_PAGE_VISIT_TYPED,
EPHY_PAGE_VISIT_MANUAL_SUBFRAME,
@@ -37,6 +38,8 @@ typedef enum {
EPHY_PAGE_VISIT_STARTUP,
EPHY_PAGE_VISIT_FORM_SUBMISSION,
EPHY_PAGE_VISIT_FORM_RELOAD,
+ EPHY_PAGE_VISIT_BOOKMARK,
+ EPHY_PAGE_VISIT_HOMEPAGE
} EphyHistoryPageVisitType;
typedef enum {