mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 04:20:38 +00:00
* Source/NSPasteboard.m (+pasteboardByFilteringFile:): Correct
typo in Richard's change. * Source/NSPasteboard.m (-pasteboard:provideDataForType:): Use the file name directly instead of reading the file contents. * Source/NSImageRep.m (+imageRepsWithContentsOfFile:, +imageFileTypes): Start working on filter service support for images. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34741 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4efb00ae4c
commit
0bf9693431
3 changed files with 108 additions and 43 deletions
|
@ -747,36 +747,40 @@ static NSString *namePrefix = @"NSTypedFilenamesPboardType:";
|
|||
[sender setData: [NSData data] forType: type];
|
||||
return; // Not the name of a file to filter.
|
||||
}
|
||||
if (data != nil)
|
||||
{
|
||||
d = data;
|
||||
}
|
||||
else if (file != nil)
|
||||
{
|
||||
d = [NSData dataWithContentsOfFile: file];
|
||||
}
|
||||
else
|
||||
{
|
||||
d = [pboard dataForType: fromType];
|
||||
}
|
||||
|
||||
o = [NSDeserializer deserializePropertyListFromData: d
|
||||
mutableContainers: NO];
|
||||
if ([o isKindOfClass: [NSString class]] == YES)
|
||||
if (file != nil)
|
||||
{
|
||||
filename = o;
|
||||
}
|
||||
else if ([o isKindOfClass: [NSArray class]] == YES
|
||||
&& [o count] > 0
|
||||
&& [[o objectAtIndex: 0] isKindOfClass: [NSString class]] == YES)
|
||||
{
|
||||
filename = [o objectAtIndex: 0];
|
||||
filename = file;
|
||||
}
|
||||
else
|
||||
{
|
||||
[sender setData: [NSData data] forType: type];
|
||||
return; // Not the name of a file to filter.
|
||||
}
|
||||
{
|
||||
if (data != nil)
|
||||
{
|
||||
d = data;
|
||||
}
|
||||
else
|
||||
{
|
||||
d = [pboard dataForType: fromType];
|
||||
}
|
||||
|
||||
o = [NSDeserializer deserializePropertyListFromData: d
|
||||
mutableContainers: NO];
|
||||
if ([o isKindOfClass: [NSString class]] == YES)
|
||||
{
|
||||
filename = o;
|
||||
}
|
||||
else if ([o isKindOfClass: [NSArray class]] == YES
|
||||
&& [o count] > 0
|
||||
&& [[o objectAtIndex: 0] isKindOfClass: [NSString class]] == YES)
|
||||
{
|
||||
filename = [o objectAtIndex: 0];
|
||||
}
|
||||
else
|
||||
{
|
||||
[sender setData: [NSData data] forType: type];
|
||||
return; // Not the name of a file to filter.
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Set up and launch task to filter the named file.
|
||||
|
@ -1139,12 +1143,12 @@ static NSMapTable *mimeMap = NULL;
|
|||
{
|
||||
originalTypes = [NSArray arrayWithObjects:
|
||||
NSCreateFilenamePboardType(ext),
|
||||
NSFilenamePboardType,
|
||||
NSFilenamesPboardType,
|
||||
nil];
|
||||
}
|
||||
else
|
||||
{
|
||||
originalTypes = [NSArray arrayWithObject: NSFilenamePboardType];
|
||||
originalTypes = [NSArray arrayWithObject: NSFilenamesPboardType];
|
||||
}
|
||||
types = [GSFiltered _typesFilterableFrom: originalTypes];
|
||||
p = (GSFiltered*)[GSFiltered pasteboardWithUniqueName];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue