[Bug 31376] TpFileTransferChannel : high level API for FT

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Mar 4 01:23:57 CET 2011


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

--- Comment #3 from Danielle Madeley <danielle.madeley at collabora.co.uk> 2011-03-03 16:23:57 PST ---
(In reply to comment #1)

> TpFTState *tp_ft_channel_get_state (TpFTChannel *self);
> const gchar *tp_ft_channel_get_content_type (TpFTChannel *self);
> const gchar *tp_ft_channel_get_filename (TpFTChannel *self);
> guint64 *tp_ft_channel_get_size (TpFTChannel *self);
> TpFTHashType tp_ft_channel_get_content_hash_type (TpFTChannel *self);
> const gchar *tp_ft_channel_get_content_hash (TpFTChannel *self);
> const gchar *tp_ft_channel_get_description (TpFTChannel *self);
> gint64 *tp_ft_channel_get_date (TpFTChannel *self);
> guint64 *tp_ft_channel_get_transferred_bytes (TpFTChannel *self);
> guint64 *tp_ft_channel_get_initial_offset (TpFTChannel *self);
> const gchar *tp_ft_channel_get_uri (TpFTChannel *self);

state, content-type, filename, size, description, date, transferred-bytes and
uri should all be GObject properties.

I'm not sure it's useful to expose initial-offset, content-hash or
content-hash-type, these are all internal to the channel (the channel should
deal with the initial offset, and also confirm the hash for us -- we need a
mechanism to know the hash is bad though).

I think we should also add a "transferred-percentage" property which is a
double ranging from [0,1], this allows programmers to create a GBinding to bind
the file transfer channel straight to a GtkProgressBar.

> Signals
> -------
> 
> "transferred-bytes-changed" (guint64 count);

Just use notify::transferred-bytes -- this also lets users bind the transferred
bytes to a GtkLabel via a transform function to pretty print it (I'd say we
should provide that function, but tp-glib doesn't provide i18n, we should get
something for it in GLib perhaps).

> "uri-defined" (const gchar uri);

Just use notify::uri -- as cassidy has already said.

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