[epiphany] ephy-bookmarks: use the new history service when possible



commit 7d56d43b180e1c24a5114b778e6898e126118f07
Author: Xan Lopez <xan igalia com>
Date:   Tue Mar 6 22:25:05 2012 +0100

    ephy-bookmarks: use the new history service when possible
    
    The 'cleared' stuff is easy to port. The rest, not so much, because
    the API to get the visit count is async.

 src/bookmarks/Makefile.am      |    1 +
 src/bookmarks/ephy-bookmarks.c |   12 +++++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/bookmarks/Makefile.am b/src/bookmarks/Makefile.am
index 7231932..5843ec9 100644
--- a/src/bookmarks/Makefile.am
+++ b/src/bookmarks/Makefile.am
@@ -104,6 +104,7 @@ libephybookmarks_la_CPPFLAGS = \
 	-I$(top_srcdir)/src		\
 	-I$(top_srcdir)/embed		\
 	-I$(top_srcdir)/lib/widgets	\
+	-I$(top_srcdir)/lib/history	\
 	-I$(top_srcdir)/lib/egg		\
 	-DDATADIR=\""$(pkgdatadir)"\" 	\
 	$(AM_CPPFLAGS)
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 76e717d..3b854cb 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -30,6 +30,7 @@
 #include "ephy-embed-shell.h"
 #include "ephy-file-helpers.h"
 #include "ephy-history.h"
+#include "ephy-history-service.h"
 #include "ephy-node-common.h"
 #include "ephy-prefs.h"
 #include "ephy-settings.h"
@@ -371,7 +372,7 @@ clear_favorites (EphyBookmarks *bookmarks)
 }
 
 static void
-history_cleared_cb (EphyHistory *history,
+history_cleared_cb (EphyHistoryService *history,
 		    EphyBookmarks *bookmarks)
 {
 	clear_favorites (bookmarks);
@@ -475,6 +476,7 @@ static void
 ephy_setup_history_notifiers (EphyBookmarks *eb)
 {
 	EphyHistory *history;
+	EphyHistoryService *history_service;
 
 	history = EPHY_HISTORY (ephy_embed_shell_get_global_history (embed_shell));
 
@@ -483,10 +485,14 @@ ephy_setup_history_notifiers (EphyBookmarks *eb)
 		clear_favorites (eb);
 	}
 
-	g_signal_connect (history, "visited",
-			  G_CALLBACK (history_site_visited_cb), eb);
+	history_service = EPHY_HISTORY_SERVICE (ephy_embed_shell_get_global_history_service (embed_shell));
+	/* FIXME: do we want an enable/disable API for the new history? */
+
 	g_signal_connect (history, "cleared",
 			  G_CALLBACK (history_cleared_cb), eb);
+
+	g_signal_connect (history, "visited",
+			  G_CALLBACK (history_site_visited_cb), eb);
 	g_signal_connect (history, "redirect",
 			  G_CALLBACK (redirect_cb), eb);
 	g_signal_connect (history, "icon-updated",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]