dropping remote content vol.2

Sebastian Kügler sebas at kde.org
Fri May 1 18:35:21 CEST 2009


I've been hacking on dropping URLs onto Plasma again, and although I got a bit 
further, I'm running into problems still. Let me first explain the concept:

- Something is dropped onto Plasma
- we don't understand its mimetype since it's remote content
- we open a QMenu stating "fetching mimetype" or similar
- the dropEvent and the QMenu are stored in a QHash, indexed by a TransferJob 
  that's started to retrieve the mimetype
- We catch the signal mimeType(KJob*, QString)
- We get the dropEvent associated with this "drop" using dropEvent[job]
  (We need this for the coordinates to create the applet at)
- We get the QMenu associated using dropMenu[job]
  (We want to recycle this QMenu, clear it and insert our choices so the user 
  can pick an applet to load)
- Profit. Wait, no profit yet. :/

While the mechanism works fine for the dropEvent, it looks like the QMenu 
vanishes somehow, dropMenu[job] returns a null-pointer. I assume the QMenu is 
taking a break and going on a long vacation there somewhere.

I'm a bit puzzled by this, can anyone enlighten me?


Dirty, dirty patch attached. Feedback is of course welcome.
-- 
sebas

 http://www.kde.org | http://vizZzion.org |  GPG Key ID: 9119 0EF9 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: plasma-drop-remote-urls2.diff
Type: text/x-patch
Size: 12588 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090501/fa7244d0/attachment-0001.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090501/fa7244d0/attachment-0001.sig 


More information about the Plasma-devel mailing list