[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GWorkspace Dragndrop Question

From: Enrico Sersale
Subject: Re: GWorkspace Dragndrop Question
Date: Mon, 23 Jun 2003 19:30:54 +0300

On 2003-06-23 18:46:01 +0300 Fred Kiefer <address@hidden> wrote:

Enrico Sersale wrote:
On 2003-06-23 16:32:18 +0300 Fred Kiefer <address@hidden> wrote:

Hi Chad,

what you describe is an inconsistency between GWorkspace and the GNUstep GUI. 
And as you did find out GUI in this case is right, as it does the same as 
Cocoa. They both expect the copy/paste of NSFilenamesPboardType to work with 
the propertylist interface of the pastboard (which internally uses an 
NSSerializer), wheras GWorkspace uses an NSArchiver for the same task. The 
difference can be seen in the method on [NSView 
dragFile:fromRect:slideBack:event:] in GUI and the methods on IconViewsIcon in 
GWorkspace. Gworkspace will need some corrections here.

Ok, I can correct this in ten minutes :-) But, due of my bad English, I don't 
understand well if I can pass an array to -setPropertyList:forType:. GWorkspace 
uses only arrays, even with a single file.

Yes this is an allowed type to put into this method, In this case even the 
expected type. As I wrote below the current GUI code looks incorrect to me.

I'm correcting this and it seems to work. But I see that this will create 
problems with other apps.
For example, GNUMail, trying to dnd a file from GW to append it to a mail, now 
#4  0x4050f9c4 in -[NSUnarchiver initForReadingWithData:] (self=0x8583be8,    
_cmd=0x405d7780, anObject=0x8459750) at NSUnarchiver.m:447
#5  0x4050f469 in +[NSUnarchiver unarchiveObjectWithData:] (self=0x405d7520,    
_cmd=0x81261a8, anObject=0x8459750) at NSUnarchiver.m:363
Looking in the GNUMail sources I see that the two versions are ifdefed: on 
GNUstep GNUMail uses a NSUnarchiver, while, on Os X, the other interface.
This means that many applications - well, we have not precisely *many* apps :-) 
- must be fixed, too.

I am also not sure if the GNUstep implementation is fully correct, as a single 
filename may be set here, where I would always expect an array of filenames. 
But than again, I did write this code some time ago, so it may be wrong. It 
looks like this is closely related with NSImage also only expecting one file 
name in the pasteboard. Both should be corrected.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]