[squeak-dev] DropPlugin usage questions

tim Rowledge tim at rowledge.org
Fri Apr 11 00:57:17 UTC 2014

I’ve just had to fix up some code that handled file drops. Since it was easy to mooch off the code in PasteUpMorph, that’s what I did - but I’m wondering what the reason is for the rather convoluted code in StandardFileStream class>requestDropStream:

So far as I can tell the DropPlugin code provides a string representing the dropped file (along with the event carrying the number of files dropped etc) and then we immediately ask the plugin for an actual file handle. It’s a bit hard to see why the plugin needs to do that since we can open a file easily enough in other ways. I can see from the *nix and Mac OS code that they are just opening files ‘normally’ (and I agree with Ian’s comment  /* you cannot be serious? */ by the way). The win32 code is less intelligible but seems to be doing much the same. Does anyone remember why we ended up going to this trouble to do something the hard way instead of passing the client a filename? The code in ExternalDropHandler spends much of its time dealing with the filename anyway.

tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Fractured Idiom:- HARLEZ-VOUS FRANCAIS? - Can you drive a French motorcycle?

More information about the Squeak-dev mailing list