mirror of
https://github.com/gnustep/apps-gorm.git
synced 2025-04-22 22:20:44 +00:00
More improvements to the resource manager.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/gorm/trunk@21086 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5a0150c3bb
commit
80bcf1a1ec
2 changed files with 22 additions and 11 deletions
|
@ -1,3 +1,8 @@
|
|||
2005-04-11 01:38 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormLib/IBResourceManager.m: Made addResourcesFromPasteboard: call
|
||||
addResources: for each array for a given type from the pasteboard.
|
||||
|
||||
2005-04-11 01:04 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||
|
||||
* GormCore/GormDocument.m
|
||||
|
|
|
@ -143,17 +143,23 @@ static NSMapTable *_resourceManagers = NULL;
|
|||
|
||||
- (void) addResourcesFromPasteboard: (NSPasteboard *)pboard
|
||||
{
|
||||
NSArray *types = [pboard types];
|
||||
NSArray *resourcePbTypes = [self resourcePasteboardTypes];
|
||||
NSString *type = [types firstObjectCommonWithArray: resourcePbTypes];
|
||||
|
||||
/*
|
||||
* Ask the document to get the dragged objects from the pasteboard and
|
||||
* add them to it's collection of known objects.
|
||||
*/
|
||||
[document pasteType: type
|
||||
fromPasteboard: pboard
|
||||
parent: nil];
|
||||
NSArray *resourcePbTypes = [self resourcePasteboardTypes];
|
||||
NSString *type = nil;
|
||||
NSEnumerator *en = [resourcePbTypes objectEnumerator];
|
||||
|
||||
while((type = [en nextObject]) != nil)
|
||||
{
|
||||
NSData *data = [pboard dataForType: type];
|
||||
if(data != nil)
|
||||
{
|
||||
id obj = [NSUnarchiver unarchiveObjectWithData: data];
|
||||
if(obj != nil)
|
||||
{
|
||||
// the object is an array of objects of this type.
|
||||
[self addResources: obj];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void) application: (NSString *) appName didModifyFileAtPath: (NSString *)path
|
||||
|
|
Loading…
Reference in a new issue