[Bug 33213] Rename _get_events() to get_entities()

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jan 19 19:41:18 CET 2011


https://bugs.freedesktop.org/show_bug.cgi?id=33213

Emilio Pozuelo Monfort <pochu27 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pochu27 at gmail.com

--- Comment #1 from Emilio Pozuelo Monfort <pochu27 at gmail.com> 2011-01-19 10:41:17 PST ---
+/* This macro is used to check if a list has been taken by an _finish()
+ * function call. It detects the the marker set by _take_list() method. Those
+ * are use to avoid copying the full list on every calls. */

an _finish -> a _finish
the the -> the
are use -> are used
every calls -> every call

-      _search_in_identifier_async_result_free);
+      (GDestroyNotify) tpl_log_manager_search_free);

-      _search_new_async_result_free);
+      (GDestroyNotify) tpl_log_manager_search_free);

I don't think you need the cast here.

Please split this commit in two, one for the free funcs and another for the
_take_list.

For the second commit:

The _get_events() method was miss-leading. This function would return
partially filled TplLogSearchHit that would in fact represent entities.
This patch rename the function an return GList of TplEntity.

miss-leading -> misleading
rename -> renames
an return -> and returns a


-GList * _tpl_log_manager_get_events (TplLogManager *manager,
+GList * _tpl_log_manager_get_entities (TplLogManager *manager,

OK, that's fine as that's what that function is doing anyway. We may want to
write a tpl_log_manager_get_events() function that actually returns a list of
TplEvents (that would be needed for my new Empathy viewer proposal for
example).


-gint _tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
-    TplLogSearchHit *b);
+/*gint _tpl_log_manager_search_hit_compare (TplLogSearchHit *a,
+    TplLogSearchHit *b);*/

Just remove it.


+ * _tpl_entity_compare:
+ * @a: a #TplEntity
+ * @b: a #TplEntity
+_tpl_entity_compare (TplEntity *e1,
+    TplEntity *e2)

Either rename e1/e2 or @a/@b. Also make it consistent with the header if you
decide to make it a/b.

-  g_return_val_if_fail (a != NULL && a->id != NULL, 1);
-  g_return_val_if_fail (b != NULL && b->id != NULL, 1);

Why remove the != NULL check? If we keep them they should become TPL_IS_ENTITY
though.


- * Returns: a list of pointer to TplLogSearchHit, having id and
- * type fields filled. The result needs to be freed after use, see
- * _tpl_log_manager_search_hit_free()
+ * Returns: a list of pointer to #TplEntity, The result needs to be freed
after
+ * use.

Do the TplEntities need to be unreffed? Please mention that there too.

+ * tpl_log_manager_get_entities_finish:

+ * @chats: a pointer to a #GList used to return the list of #TplEntity
     GList **events,

events should be renamed to entities I guess. And @chats too.


-gboolean tpl_log_manager_get_events_finish (TplLogManager *self,
+gboolean tpl_log_manager_get_entities_finish (TplLogManager *self,
     GAsyncResult *result,
     GList **events,

Likewise.


+      /* FIXME Facking alias with identifier */

Faking I think.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list