[epiphany/overview] ephy-overview-store: add API to find a url in the model
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/overview] ephy-overview-store: add API to find a url in the model
- Date: Mon, 20 Aug 2012 16:12:09 +0000 (UTC)
commit 6a8218cca630df6135d9235f1ad7e1bc034308ed
Author: Claudio Saavedra <csaavedra igalia com>
Date: Sun Aug 19 18:10:36 2012 +0300
ephy-overview-store: add API to find a url in the model
lib/widgets/ephy-overview-store.c | 29 +++++++++++++++++++++++++++++
lib/widgets/ephy-overview-store.h | 4 ++++
2 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/lib/widgets/ephy-overview-store.c b/lib/widgets/ephy-overview-store.c
index 12562ee..0e4e48b 100644
--- a/lib/widgets/ephy-overview-store.c
+++ b/lib/widgets/ephy-overview-store.c
@@ -478,3 +478,32 @@ ephy_overview_store_remove (EphyOverviewStore *store,
return gtk_list_store_remove (GTK_LIST_STORE (store), iter);
}
+
+gboolean
+ephy_overview_store_find_url (EphyOverviewStore *store,
+ const char *url,
+ GtkTreeIter *iter)
+{
+ gboolean valid, found = FALSE;
+ char *row_url;
+
+ g_return_val_if_fail (EPHY_IS_OVERVIEW_STORE (store), FALSE);
+ g_return_val_if_fail (url != NULL, FALSE);
+
+ valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), iter);
+
+ while (valid) {
+ gtk_tree_model_get (GTK_TREE_MODEL (store), iter,
+ EPHY_OVERVIEW_STORE_URI, &row_url,
+ -1);
+
+ found = g_strcmp0 (row_url, url) == 0;
+ g_free (row_url);
+ if (found)
+ break;
+
+ valid = gtk_tree_model_iter_next (GTK_TREE_MODEL (store), iter);
+ }
+
+ return found;
+}
diff --git a/lib/widgets/ephy-overview-store.h b/lib/widgets/ephy-overview-store.h
index 7ea0dd1..6d80a36 100644
--- a/lib/widgets/ephy-overview-store.h
+++ b/lib/widgets/ephy-overview-store.h
@@ -81,6 +81,10 @@ gboolean ephy_overview_store_needs_snapshot (EphyOverviewStore *store,
gboolean ephy_overview_store_remove (EphyOverviewStore *store,
GtkTreeIter *iter);
+gboolean ephy_overview_store_find_url (EphyOverviewStore *store,
+ const char *url,
+ GtkTreeIter *iter);
+
G_END_DECLS
#endif /* _EPHY_OVERVIEW_STORE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]