summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-05-27 11:38:13 +0200
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-05-27 11:38:13 +0200
commiteb253fc01094e03a39d0dfff38764b5aa6ccf155 (patch)
treec4d92e3c8539b00f38ea9de5f7c7f1620374a2c5
parentc1535c6bc7dc8b1cf5370bb3e771e7d633cc761b (diff)
log-manager: move API not used by Empathy as internal
-rw-r--r--telepathy-logger/log-manager-priv.h18
-rw-r--r--telepathy-logger/log-manager.c27
-rw-r--r--telepathy-logger/log-manager.h14
-rw-r--r--tests/test-searches.c6
4 files changed, 35 insertions, 30 deletions
diff --git a/telepathy-logger/log-manager-priv.h b/telepathy-logger/log-manager-priv.h
index 3e4ce88e5..7019b5d14 100644
--- a/telepathy-logger/log-manager-priv.h
+++ b/telepathy-logger/log-manager-priv.h
@@ -71,5 +71,23 @@ GList * _tpl_log_manager_search_in_identifier_chats_new (TplLogManager *manager,
GList * _tpl_log_manager_search_new (TplLogManager *manager,
const gchar *text);
+gboolean _tpl_log_manager_search_in_identifier_chats_new_finish (
+ TplLogManager *self,
+ GAsyncResult *result,
+ GList **chats,
+ GError **error);
+
+void _tpl_log_manager_search_in_identifier_chats_new_async (
+ TplLogManager *manager,
+ TpAccount *account,
+ gchar const *chat_id,
+ const gchar *text,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+
+void _tpl_log_manager_search_hit_free (TplLogSearchHit *hit);
+
+gint _tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
+ TplLogSearchHit *b);
#endif /* __TPL_LOG_MANAGER_PRIV_H__ */
diff --git a/telepathy-logger/log-manager.c b/telepathy-logger/log-manager.c
index bf77dc943..28a625d40 100644
--- a/telepathy-logger/log-manager.c
+++ b/telepathy-logger/log-manager.c
@@ -529,7 +529,7 @@ _tpl_log_manager_get_filtered_messages (TplLogManager *manager,
/**
- * tpl_log_manager_search_hit_compare:
+ * _tpl_log_manager_search_hit_compare:
* @a: a TplLogSerachHit
* @b: a TplLogSerachHit
*
@@ -544,7 +544,7 @@ _tpl_log_manager_get_filtered_messages (TplLogManager *manager,
*
* Returns: -1 if a > b, 1 if a < b or 0 is a == b */
gint
-tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
+_tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
TplLogSearchHit *b)
{
/* if chat_ids differ, just return their sorting return value */
@@ -586,7 +586,7 @@ tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
*
* Returns: a list of pointer to TplLogSearchHit, having chat_id and
* is_chatroom fields filled. the result needs to be freed after use using
- * #tpl_log_manager_search_hit_free
+ * _tpl_log_manager_search_hit_free
*/
GList *
_tpl_log_manager_get_chats (TplLogManager *manager,
@@ -613,14 +613,14 @@ _tpl_log_manager_get_chats (TplLogManager *manager,
TplLogSearchHit *hit = in->data;
if (g_list_find_custom (out, hit,
- (GCompareFunc) tpl_log_manager_search_hit_compare) == NULL)
+ (GCompareFunc) _tpl_log_manager_search_hit_compare) == NULL)
{
/* add data if not already present */
out = g_list_prepend (out, hit);
}
else
/* free hit if already present in out */
- tpl_log_manager_search_hit_free (hit);
+ _tpl_log_manager_search_hit_free (hit);
}
g_list_free (in);
}
@@ -682,7 +682,7 @@ _tpl_log_manager_search_new (TplLogManager *manager,
void
-tpl_log_manager_search_hit_free (TplLogSearchHit *hit)
+_tpl_log_manager_search_hit_free (TplLogSearchHit *hit)
{
if (hit->account != NULL)
g_object_unref (hit->account);
@@ -702,7 +702,7 @@ tpl_log_manager_search_free (GList *hits)
for (l = hits; l != NULL; l = g_list_next (l))
{
- tpl_log_manager_search_hit_free (l->data);
+ _tpl_log_manager_search_hit_free (l->data);
}
g_list_free (hits);
@@ -1283,7 +1283,7 @@ tpl_log_manager_get_chats_async (TplLogManager *manager,
/* Start of tpl_log_manager_search_in_identifier_chats_new async
* implementation */
gboolean
-tpl_log_manager_search_in_identifier_chats_new_finish (TplLogManager *self,
+_tpl_log_manager_search_in_identifier_chats_new_finish (TplLogManager *self,
GAsyncResult *result,
GList **chats,
GError **error)
@@ -1293,7 +1293,8 @@ tpl_log_manager_search_in_identifier_chats_new_finish (TplLogManager *self,
g_return_val_if_fail (TPL_IS_LOG_MANAGER (self), FALSE);
g_return_val_if_fail (G_IS_SIMPLE_ASYNC_RESULT (result), FALSE);
g_return_val_if_fail (g_simple_async_result_is_valid (result,
- G_OBJECT (self), tpl_log_manager_search_in_identifier_chats_new_finish),
+ G_OBJECT (self),
+ _tpl_log_manager_search_in_identifier_chats_new_async),
FALSE);
simple = G_SIMPLE_ASYNC_RESULT (result);
@@ -1313,7 +1314,7 @@ _search_in_identifier_chats_new_async_result_free (gpointer data)
GList *lst = data; /* list of TplSearchHit */
g_return_if_fail (data != NULL);
- g_list_foreach (lst, (GFunc) tpl_log_manager_search_hit_free, NULL);
+ g_list_foreach (lst, (GFunc) _tpl_log_manager_search_hit_free, NULL);
g_list_free (lst);
}
@@ -1339,7 +1340,7 @@ _search_in_identifier_chats_new_async_thread (GSimpleAsyncResult *simple,
void
-tpl_log_manager_search_in_identifier_chats_new_async (TplLogManager *manager,
+_tpl_log_manager_search_in_identifier_chats_new_async (TplLogManager *manager,
TpAccount *account,
gchar const *identifier,
const gchar *text,
@@ -1372,7 +1373,7 @@ tpl_log_manager_search_in_identifier_chats_new_async (TplLogManager *manager,
simple = g_simple_async_result_new (G_OBJECT (manager),
_tpl_log_manager_async_operation_cb, async_data,
- tpl_log_manager_search_in_identifier_chats_new_async);
+ _tpl_log_manager_search_in_identifier_chats_new_async);
g_simple_async_result_run_in_thread (simple,
_search_in_identifier_chats_new_async_thread, 0, NULL);
@@ -1411,7 +1412,7 @@ _search_new_async_result_free (gpointer data)
GList *lst = data; /* list of TplSearchHit */
g_return_if_fail (data != NULL);
- g_list_foreach (lst, (GFunc) tpl_log_manager_search_hit_free, NULL);
+ g_list_foreach (lst, (GFunc) _tpl_log_manager_search_hit_free, NULL);
g_list_free (lst);
}
diff --git a/telepathy-logger/log-manager.h b/telepathy-logger/log-manager.h
index 70d87bee0..9024b8a46 100644
--- a/telepathy-logger/log-manager.h
+++ b/telepathy-logger/log-manager.h
@@ -118,16 +118,6 @@ gboolean tpl_log_manager_get_chats_finish (TplLogManager *self,
void tpl_log_manager_get_chats_async (TplLogManager *manager,
TpAccount *account, GAsyncReadyCallback callback, gpointer user_data);
-gboolean tpl_log_manager_search_in_identifier_chats_new_finish (
- TplLogManager *self,
- GAsyncResult *result,
- GList **chats,
- GError **error);
-
-void tpl_log_manager_search_in_identifier_chats_new_async (TplLogManager *manager,
- TpAccount *account, gchar const *chat_id, const gchar *text,
- GAsyncReadyCallback callback, gpointer user_data);
-
gboolean tpl_log_manager_search_new_finish (TplLogManager *self,
GAsyncResult *result,
GList **chats,
@@ -140,9 +130,5 @@ void tpl_log_manager_search_free (GList *hits);
gchar *tpl_log_manager_get_date_readable (const gchar *date);
-void tpl_log_manager_search_hit_free (TplLogSearchHit *hit);
-gint tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
- TplLogSearchHit *b);
-
G_END_DECLS
#endif /* __TPL_LOG_MANAGER_H__ */
diff --git a/tests/test-searches.c b/tests/test-searches.c
index 3f3119413..d46601726 100644
--- a/tests/test-searches.c
+++ b/tests/test-searches.c
@@ -74,12 +74,12 @@ main (int argc, char *argv[])
/* we do not want duplicates */
ret = _tpl_log_manager_get_chats (manager, acc);
- ret = g_list_sort (ret, (GCompareFunc) tpl_log_manager_search_hit_compare);
+ ret = g_list_sort (ret, (GCompareFunc) _tpl_log_manager_search_hit_compare);
for (loc = ret; loc; loc = g_list_next (loc))
if (loc->next)
- g_assert (tpl_log_manager_search_hit_compare (loc->data,
+ g_assert (_tpl_log_manager_search_hit_compare (loc->data,
loc->next->data) != 0);
- g_list_foreach (ret, (GFunc) tpl_log_manager_search_hit_free, NULL);
+ g_list_foreach (ret, (GFunc) _tpl_log_manager_search_hit_free, NULL);
g_list_free (ret);