[Bug 37034] Telepathy-Qt4 doesn't set the URI property for file transfers.

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu May 12 23:14:34 CEST 2011


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

--- Comment #1 from Andre Moreira Magalhaes <andrunko at gmail.com> 2011-05-12 14:14:34 PDT ---
(In reply to comment #0)
> Telepathy-Qt4 doesn't set the URI property for file transfers.
> Therefore if the handler is not the same that initiates the transfer channel,
> it is impossible to know the location of the file that should be sent and to
> open the file in order to call
> OutgoingFileTransferChannel::provideFile(QIODevice* input).    
> 
> FileTransferChannelCreationProperties only accepts a "suggestedFileName".
> Moreover accounts.cpp:271 uses QFileInfo for a suggestedFileName. If the file
> name is just "suggested" it could be set by the user and could not correspond
> to a real file. (This is probably another bug)
This is not a bug, it just binds
http://telepathy.freedesktop.org/spec/Channel_Type_File_Transfer.html#Property:Filename
which states this is a suggested filename.

> Therefore if the "suggestedFileName" corresponds to a real file, it is possible
> to set the URI property getting the absolute path, otherwise it is impossible.
> 
> I can work on this but I need to know how should I fix it...
> 
> 1) Add a setUri method to FileTransferChannelCreationProperties
> 2) Add a constructor to FileTransferChannelCreationProperties(const QString
> &uri) (that might also set size, hash, content, etc)
> 3) Just rename "suggestedFileName" to "uri", fix documentation and hope that
> nobody uses it yet with a non existent file.
> 
> In my opinion #2 is the best.
> 
> I also suggest that (but this will break abi compatibility)
> - the "FileTransferChannelCreationProperties(const QString &suggestedFileName,
>   const QString &contentType, qulonglong size);" constructor should be removed;
> - a method setSuggestedFileName(const QString &suggestedFileName) should be
>   added to override the default name extracted from the URI.

What I suggest is to mix 1 and 2, but the constructor should take the uri and
suggestedFileName and have a setSuggestedFileName as well. If the
suggestedFilename passed is empty use uri. setSuggestedFilename should do the
same if the filename is empty and use uri instead.

And please do not remove anything, just deprecate the other constructor taking
only a suggested filename. Adding new methods won't break API.

Also add a FT::uri() accessor.

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