Regression in P7 with drag and drop

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Regression in P7 with drag and drop

HilaireFernandes
Hi,

PasteUpMorph>>dropFiles:

looks wrong in P7.

A Write stream is created while a Read stream is expected.

Result: drag and drop of a sketch file does not work anymore in DrGeo.

Should it be a binary read stream or just a read stream?

With a read stream it works fine for DrGeo, not sure about other.

Enclosed .st of the edited method.

Please, some one with know fill a bug ticket with the proposed fix.

Thanks

Hilaire

--
Dr. Geo
http://drgeo.eu


PasteUpMorph-dropFiles.st (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Regression in P7 with drag and drop

Sven Van Caekenberghe-2
That method was fixed as follows in Pharo 8

PasteUpMorph>>#dropFiles: anEvent
        "Handle a number of dropped files from the OS.
        TODO:
                - use a more general mechanism for figuring out what to do with the file (perhaps even offering a choice from a menu)
                - remember the resource location or (when in browser) even the actual file handle"
        | numFiles |
        numFiles := anEvent contents.
       
        1 to: numFiles do: [:i | | aFileReference handler |
                aFileReference := FileReference requestDropReference: i.
                handler := ExternalDropHandler lookupExternalDropHandler: aFileReference.
                handler ifNotNil: [ aFileReference binaryWriteStreamDo: [ :stream | handler handle: stream in: self dropEvent: anEvent ] ]].

> On 27 Jun 2019, at 22:41, Hilaire <[hidden email]> wrote:
>
> Hi,
>
> PasteUpMorph>>dropFiles:
>
> looks wrong in P7.
>
> A Write stream is created while a Read stream is expected.
>
> Result: drag and drop of a sketch file does not work anymore in DrGeo.
>
> Should it be a binary read stream or just a read stream?
>
> With a read stream it works fine for DrGeo, not sure about other.
>
> Enclosed .st of the edited method.
>
> Please, some one with know fill a bug ticket with the proposed fix.
>
> Thanks
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
> <PasteUpMorph-dropFiles.st>


Reply | Threaded
Open this post in threaded view
|

Re: Regression in P7 with drag and drop

HilaireFernandes
It was changed like that as early as in P7. It does not work. How could
the dragged and dropped file opened as a write stream?

Replacing binaryWriteStreamDo: wtih readStreamDo: make it work for
DrGeo. I don't know about other scenario usage.

Hilaire

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Regression in P7 with drag and drop

HilaireFernandes
And there is an issue with the Default drop handler.

Try to drop a text file in P7 or likely P8 image.

Message #name is expected to be understandble by Stream, but it is not
any more the case.

Hilaire

--
Dr. Geo
http://drgeo.eu

--
Dr. Geo
http://drgeo.eu



Reply | Threaded
Open this post in threaded view
|

Re: Regression in P7 with drag and drop

ducasse
thanks for the report.
Hilaire could you open a bug entry and we will issue a fix for P7 and P8

S.

> On 28 Jun 2019, at 07:16, Hilaire <[hidden email]> wrote:
>
> And there is an issue with the Default drop handler.
>
> Try to drop a text file in P7 or likely P8 image.
>
> Message #name is expected to be understandble by Stream, but it is not
> any more the case.
>
> Hilaire
>
> --
> Dr. Geo
> http://drgeo.eu
>
> --
> Dr. Geo
> http://drgeo.eu
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Regression in P7 with drag and drop

HilaireFernandes
https://github.com/pharo-project/pharo/issues/3679

Le 28/06/2019 à 03:09, ducasse a écrit :
> thanks for the report.
> Hilaire could you open a bug entry and we will issue a fix for P7 and P8
>
> S.

--
Dr. Geo
http://drgeo.eu