[Bug 31376] TpFileTransferChannel : high level API for FT
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Feb 15 12:59:21 CET 2011
https://bugs.freedesktop.org/show_bug.cgi?id=31376
--- Comment #2 from Guillaume Desmottes <guillaume.desmottes at collabora.co.uk> 2011-02-15 03:59:20 PST ---
(In reply to comment #1)
> As per our discussion, here's an attempt at a first API draft:
I think we should name this TpFileTransferChannel.
> Properties and accessors
> ------------------------
>
> TpFTState *tp_ft_channel_get_state (TpFTChannel *self);
That's TpFileTransferState.
Do we really want to expose this to the user? If we succeed send/receive
operation when the sending is done, can't we just use the GError of the
_finish() function to tell user about failures?
> TpFTHashType tp_ft_channel_get_content_hash_type (TpFTChannel *self);
> const gchar *tp_ft_channel_get_content_hash (TpFTChannel *self);
Humm maybe we shouldn't expose that and let tp-glib does the hashing and
checking?
> gint64 *tp_ft_channel_get_date (TpFTChannel *self);
Maybe we could use a GDateTime instead?
> guint64 *tp_ft_channel_get_initial_offset (TpFTChannel *self);
Does clients care as tp-glib will do the streaming of the file?
> Methods
> -------
>
> void tp_ft_channel_accept_async (TpFTChannel *self,
> guint64 offset,
> GFile *file,
> GCancellable *cancellable,
> GAsyncReadyCallback callback,
> gpointer user_data);
I'd swap the offset and file args.
> void tp_ft_channel_accept_finish (TpFTChannel *self,
> GAsyncResult *result,
> GError **error);
>
> void tp_ft_channel_offer_async (TpFTChannel *self,
> GFile *file,
> GCancellable *cancellable,
> GAsyncReadyCallback callback,
> gpointer user_data);
>
> void tp_ft_channel_offer_finish (TpFTChannel *self,
> GAsyncResult *result,
> GError **error);
Do we really need a GCancellable? User can just close the channel to stop
sending/receiving. And once the operation has been cancelled we can't do much
with the channel anyway.
When are these operations succeeding? As soon as the D-Bus call returns or
when the sending/receiving is done?
> Signals
> -------
>
> "uri-defined" (const gchar uri);
No need for that, we can use "notify:uri".
--
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