[Telepathy] tp-qt4 FileTransfer API proposal
will.thompson at collabora.co.uk
Tue Sep 1 11:36:24 PDT 2009
Andre Moreira Magalhaes wrote:
> So changing it won't make much difference from what we have now. We
> would have a class with the constructor containing all the default
> values. Why let in the constructor? As they can't be changed after creation.
> Ps.: Making the members public accessible is not an option, neither
> having setters methods for them, as they can't change after creation.
I didn't envisage the FTProps object sticking around once you call
createFileTransfer(). This was just a proposed way to fake Python-style
keyword arguments, which are really what we want here:
def createFileTransfer(contact, fileName, contentType, size,
# Now applications can write:
createFileTransfer("foo at bar.com", "cat.jpg", "image/jpeg", 5000,
# omitting any arguments they don't care about.
So in C++ this would become:
FTProps p("cat.jpg", "image/jpeg", 5000);
cr = account.createFileTransfer("foo at bar.com", p)
// and never use 'p' again.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://lists.freedesktop.org/archives/telepathy/attachments/20090901/50beeb39/attachment.pgp
More information about the telepathy