[Bug 41772] TP Logger: Introduce TplEventWalker

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Jul 10 01:54:28 CEST 2012


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

--- Comment #5 from Nicolas Dufresne <nicolas.dufresne at collabora.co.uk> 2012-07-09 16:54:28 PDT ---
I did an API only review.The log manager part seems fine to me, other method
can be added later. For the TplLogWalker though I'd do some changes.

> void tpl_log_walker_get_filtered_events_async (TplLogWalker *walker,
>     guint num_events,
>     GAsyncReadyCallback callback,
>     gpointer user_data);
> 
> gboolean tpl_log_walker_get_filtered_events_finish (TplLogWalker *walker,
>     GAsyncResult *result,
>     GList **events,
>     GError **error);


In this one I'd clearly drop _filtered_, as the walker should not be that
specific. Also the filter cannot be changed anyway. Wheter it's a search, a
filtered search, or other type of data request does not matter here.

One of the thing that was important in the original design was the direction.
This one I guess is forward, though I'd appreciate to see it in the method
name. Going backward can be added later without break API.

> 
> gboolean tpl_log_walker_is_begin (TplLogWalker *walker);

This one make some sense, since we can't add event in the past. It might be
worth looking around other API to see what would be the best naming. GList uses
g_list_first() g_list_last() in a similar API, GHashTableIter does not provide
such API.

> 
> gboolean tpl_log_walker_is_end (TplLogWalker *walker);

This one does not make as much sense, as new event could be added later. I
think we should introduce an error type that says no more data, and the
direction of the request would tell if it's first or last. We should also
document that more data might be added later, there is a bug I think that
suggest adding signals when new event are inserted.

-- 
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