summaryrefslogtreecommitdiff
path: root/src/ephy-suggestion-model.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ephy-suggestion-model.c')
-rw-r--r--src/ephy-suggestion-model.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ephy-suggestion-model.c b/src/ephy-suggestion-model.c
index 023b05cfa..c56e56f6a 100644
--- a/src/ephy-suggestion-model.c
+++ b/src/ephy-suggestion-model.c
@@ -400,3 +400,24 @@ ephy_suggestion_model_query_finish (EphySuggestionModel *self,
return g_task_propagate_boolean (G_TASK (result), error);
}
+
+EphySuggestion *
+ephy_suggestion_model_get_suggestion_with_id (EphySuggestionModel *self,
+ const char *id)
+{
+ GSequenceIter *iter;
+
+ g_return_val_if_fail (EPHY_IS_SUGGESTION_MODEL (self), NULL);
+ g_return_val_if_fail (id != NULL && *id != '\0', NULL);
+
+ for (iter = g_sequence_get_begin_iter (self->items);
+ !g_sequence_iter_is_end (iter); iter = g_sequence_iter_next (iter)) {
+ EphySuggestion *suggestion;
+
+ suggestion = g_sequence_get (iter);
+ if (strcmp (dzl_suggestion_get_id (DZL_SUGGESTION (suggestion)), id) == 0)
+ return suggestion;
+ }
+
+ return NULL;
+}