diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2002-02-23 04:55:51 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2002-02-23 04:55:51 +0800 |
commit | 51b03dbcdfdc984834867a04792781ad8f073f65 (patch) | |
tree | e7a1d41940ae89408eaad53b9f6e40650ebf6b4c /shell/e-history.c | |
parent | d7ea6022c14604e845edef89e61c253804273cba (diff) | |
download | gsoc2013-evolution-51b03dbcdfdc984834867a04792781ad8f073f65.tar.gz gsoc2013-evolution-51b03dbcdfdc984834867a04792781ad8f073f65.tar.zst gsoc2013-evolution-51b03dbcdfdc984834867a04792781ad8f073f65.zip |
New helper function to remove all the matching URIs from the history.
* e-shell-view.c (remove_uri_from_history): New helper function to
remove all the matching URIs from the history.
(history_uri_matching_func): Compare function for using
e_history_remove_matching.
(storage_set_removed_folder_callback): Call
`remove_uri_from_history()'.
* e-history.c (e_history_remove_matching): New.
svn path=/trunk/; revision=15803
Diffstat (limited to 'shell/e-history.c')
-rw-r--r-- | shell/e-history.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/shell/e-history.c b/shell/e-history.c index 99579871e1..16df6cfc10 100644 --- a/shell/e-history.c +++ b/shell/e-history.c @@ -234,5 +234,29 @@ e_history_add (EHistory *history, priv->current_item = priv->current_item->next; } +void +e_history_remove_matching (EHistory *history, + const void *data, + GCompareFunc compare_func) +{ + EHistoryPrivate *priv; + GList *p; + + g_return_if_fail (history != NULL); + g_return_if_fail (E_IS_HISTORY (history)); + g_return_if_fail (compare_func != NULL); + + priv = history->priv; + + for (p = priv->items; p != NULL; p = p->next) { + if ((* compare_func) (data, p->data) == 0) { + if (priv->items == priv->current_item) + priv->items = priv->current_item = g_list_remove_link (priv->items, p); + else + priv->items = g_list_remove_link (priv->items, p); + } + } +} + E_MAKE_TYPE (e_history, "EHistory", EHistory, class_init, init, GTK_TYPE_OBJECT) |