[empathy] live-search: export few more functions
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] live-search: export few more functions
- Date: Tue, 31 May 2011 13:53:34 +0000 (UTC)
commit d4e5a5295ff83f664c80fe3af61db0692829ea1b
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Tue May 31 15:20:10 2011 +0200
live-search: export few more functions
libempathy-gtk/empathy-live-search.c | 23 +++++++++++++++--------
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 bc7cfb1..422bfcb 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 78dc236..9f06839 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]