[Kde-pim] Dragging akonadi items

Sebastian Kügler sebas at kde.org
Sun Feb 21 22:57:40 GMT 2010


On Sunday 21 February 2010 11:39:24 Ingo Klöcker wrote:
> On Sunday 21 February 2010, Robin Atwood wrote:
> > If I drag a kaddressbook item to kwrite, the akonadi: URL is resolved
> > and I can see the VCS entry in the editor. If I drag it to my
> > KLineEdit widget I just get the URL despite that I have the
> > UrlDropsEnabled property set. What am I missing? (A lot, I suspect!)
> 
> I think you misunderstand the UrlDropsEnabled property. The API
> documentation [1] says:
> =====
> void KLineEdit::setUrlDropsEnabled( bool enable )
> 
> Enables/Disables handling of URL drops.
> 
> If enabled and the user drops an URL, the decoded URL will be inserted.
> Otherwise the default behavior of QLineEdit is used, which inserts the
> encoded URL.
> =====
> 
> So, URLs will not be resolved, but just decoded, i.e. %-encoded
> characters will be converted to the corresponding Unicode character.
> 
> IMO resolving of URLs cannot be handled by a plain vanilla KLineEdit
> because what the URL should be resolved to depends on the context. An
> akonadi-URL representing a contact could be resolved to the contact's
> name, the contact's email address, the contact's phone number, etc.,
> depending on the context (i.e. does the line edit expect a name, an
> email address, a phone number, etc.).
> 
> The line edit used in KMail's composer for the email addresses is a
> subclass of KLineEdit which (among other features like address book
> completion) provides special handling of mailto:-URLs and akonadi:-URLs.
> 
> IMO a better approach than subclassing (which IMNSHO is almost always
> the wrong approach) would be making KLineEdit extensible with URL
> resolvers. Then the user of KLineEdit could add the correct resolvers
> depending on the context.

Or attaching multiple mimetypes to the drag and have the receiving end decide which 
one it wants to use. (Abstract answer, I know, and maybe I'm missing something -- 
it's late even for me ;)).
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 489 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100221/c7281970/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list