diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-31 21:20:10 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-05-31 21:20:10 +0800 |
commit | d4e5a5295ff83f664c80fe3af61db0692829ea1b (patch) | |
tree | 80ffd261b720c86cf614a567068179e69412c82b | |
parent | 4a20b26434210820bdcc2d38b9c1f4b35eb36e71 (diff) | |
download | gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar.gz gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar.bz2 gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar.lz gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar.xz gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.tar.zst gsoc2013-empathy-d4e5a5295ff83f664c80fe3af61db0692829ea1b.zip |
live-search: export few more functions
-rw-r--r-- | libempathy-gtk/empathy-live-search.c | 23 | ||||
-rw-r--r-- | libempathy-gtk/empathy-live-search.h | 7 |
2 files changed, 22 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-live-search.c b/libempathy-gtk/empathy-live-search.c index bc7cfb10f..422bfcb73 100644 --- a/libempathy-gtk/empathy-live-search.c +++ b/libempathy-gtk/empathy-live-search.c @@ -139,8 +139,8 @@ append_word (GPtrArray **word_array, } } -static GPtrArray * -strip_utf8_string (const gchar *string) +GPtrArray * +empathy_live_search_strip_utf8_string (const gchar *string) { GPtrArray *word_array = NULL; GString *word = NULL; @@ -230,8 +230,8 @@ live_search_match_prefix (const gchar *string, return FALSE; } -static gboolean -live_search_match_words (const gchar *string, +gboolean +empathy_live_search_match_words (const gchar *string, GPtrArray *words) { guint i; @@ -309,7 +309,7 @@ live_search_text_changed (GtkEntry *entry, if (priv->stripped_words != NULL) g_ptr_array_unref (priv->stripped_words); - priv->stripped_words = strip_utf8_string (text); + priv->stripped_words = empathy_live_search_strip_utf8_string (text); g_object_notify (G_OBJECT (self), "text"); } @@ -702,7 +702,7 @@ empathy_live_search_match (EmpathyLiveSearch *self, priv = GET_PRIV (self); - return live_search_match_words (string, priv->stripped_words); + return empathy_live_search_match_words (string, priv->stripped_words); } gboolean @@ -712,11 +712,18 @@ empathy_live_search_match_string (const gchar *string, GPtrArray *words; gboolean match; - words = strip_utf8_string (prefix); - match = live_search_match_words (string, words); + words = empathy_live_search_strip_utf8_string (prefix); + match = empathy_live_search_match_words (string, words); if (words != NULL) g_ptr_array_unref (words); return match; } +GPtrArray * +empathy_live_search_get_words (EmpathyLiveSearch *self) +{ + EmpathyLiveSearchPriv *priv = GET_PRIV (self); + + return priv->stripped_words; +} diff --git a/libempathy-gtk/empathy-live-search.h b/libempathy-gtk/empathy-live-search.h index 78dc236c0..9f068396c 100644 --- a/libempathy-gtk/empathy-live-search.h +++ b/libempathy-gtk/empathy-live-search.h @@ -65,6 +65,13 @@ void empathy_live_search_set_text (EmpathyLiveSearch *self, gboolean empathy_live_search_match (EmpathyLiveSearch *self, const gchar *string); +GPtrArray * empathy_live_search_strip_utf8_string (const gchar *string); + +gboolean empathy_live_search_match_words (const gchar *string, + GPtrArray *words); + +GPtrArray * empathy_live_search_get_words (EmpathyLiveSearch *self); + /* Made public for unit tests */ gboolean empathy_live_search_match_string (const gchar *string, const gchar *prefix); |