aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2012-03-08 00:53:19 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2012-03-08 05:17:54 +0800
commit7cc9e4a8e9d7a9ae063005e27bca383687b3084e (patch)
tree33233c810ad3cb87af2a8af55b65ef4981ed971a /lib
parentda98a6a19c33c67692713bd3548adb007fc8178b (diff)
downloadgsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar.gz
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar.bz2
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar.lz
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar.xz
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.tar.zst
gsoc2013-epiphany-7cc9e4a8e9d7a9ae063005e27bca383687b3084e.zip
ephy-host-store: add a clear() method
This adds always a default item "All sites" which, when selected, will show all urls in all hosts. https://bugzilla.gnome.org/show_bug.cgi?id=671575
Diffstat (limited to 'lib')
-rw-r--r--lib/widgets/ephy-hosts-store.c13
-rw-r--r--lib/widgets/ephy-hosts-store.h1
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/widgets/ephy-hosts-store.c b/lib/widgets/ephy-hosts-store.c
index ed76072e6..99fff4833 100644
--- a/lib/widgets/ephy-hosts-store.c
+++ b/lib/widgets/ephy-hosts-store.c
@@ -20,8 +20,11 @@
*/
#include "config.h"
+
#include "ephy-hosts-store.h"
+#include <glib/gi18n.h>
+
G_DEFINE_TYPE (EphyHostsStore, ephy_hosts_store, GTK_TYPE_LIST_STORE)
static void
@@ -99,3 +102,13 @@ ephy_hosts_store_get_host_from_path (EphyHostsStore *store,
-1);
return host;
}
+
+void
+ephy_hosts_store_clear (EphyHostsStore *store)
+{
+ gtk_list_store_clear (GTK_LIST_STORE (store));
+ gtk_list_store_insert_with_values (GTK_LIST_STORE (store), NULL, 0,
+ EPHY_HOSTS_STORE_COLUMN_ID, 0,
+ EPHY_HOSTS_STORE_COLUMN_TITLE, _("All sites"),
+ -1);
+}
diff --git a/lib/widgets/ephy-hosts-store.h b/lib/widgets/ephy-hosts-store.h
index 5b61902f3..40502e8a0 100644
--- a/lib/widgets/ephy-hosts-store.h
+++ b/lib/widgets/ephy-hosts-store.h
@@ -63,6 +63,7 @@ void ephy_hosts_store_add_hosts (EphyHostsStore *store, G
void ephy_hosts_store_add_host (EphyHostsStore *store, EphyHistoryHost *host);
void ephy_hosts_store_add_visits (EphyHostsStore *store, GList *visits);
EphyHistoryHost* ephy_hosts_store_get_host_from_path (EphyHostsStore *store, GtkTreePath *path);
+void ephy_hosts_store_clear (EphyHostsStore *store);
G_END_DECLS