From e2fbd102c251671d42c33c5e748ceb06c4926ceb Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Sun, 4 Mar 2012 19:11:12 +0000 Subject: Would help if I committed the right file. --- Source/SPConnectionControllerDelegate.m | 9 ++++++--- Source/SPTreeNode.m | 8 ++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'Source') diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 12a364f0..5230ff5a 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -170,7 +170,8 @@ static NSString *SPDatabaseImage = @"database-small"; } [pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:self]; - [pboard setData:[NSKeyedArchiver archivedDataWithRootObject:items] forType:SPFavoritesPasteboardDragType]; + //[pboard setData:[NSKeyedArchiver archivedDataWithRootObject:items] forType:SPFavoritesPasteboardDragType]; + [pboard setData:[NSData data] forType:SPFavoritesPasteboardDragType]; return YES; } @@ -211,10 +212,12 @@ static NSString *SPDatabaseImage = @"database-small"; { [menuItem setState:NSOffState]; } + + NSArray *nodes = [self selectedFavoriteNodes]; - NSArray *nodes = [NSKeyedUnarchiver unarchiveObjectWithData:[[info draggingPasteboard] dataForType:SPFavoritesPasteboardDragType]]; + //NSArray *nodes = [NSKeyedUnarchiver unarchiveObjectWithData:[[info draggingPasteboard] dataForType:SPFavoritesPasteboardDragType]]; - if (![nodes count]) return acceptedDrop; + //if (![nodes count]) return acceptedDrop; if ([node isGroup]) { if (index == NSOutlineViewDropOnItemIndex) { diff --git a/Source/SPTreeNode.m b/Source/SPTreeNode.m index d93db01b..f787816a 100644 --- a/Source/SPTreeNode.m +++ b/Source/SPTreeNode.m @@ -236,14 +236,18 @@ static NSString *SPTreeNodeIsGroupKey = @"SPTreeNodeIsGroup"; for (SPTreeNode *node in [self childNodes]) { - [children addObject:[node dictionaryRepresentation]]; + NSDictionary *representation = [node dictionaryRepresentation]; + + if (representation) { + [children addObject:representation]; + } } dictionary = [NSMutableDictionary dictionary]; NSString *name = (![self parentNode]) ? NSLocalizedString(@"Favorites", @"favorites label") : [object nodeName]; - [dictionary setObject:(name) ? name : @"" forKey:SPFavoritesGroupNameKey]; + [dictionary setObject:name ? name : @"" forKey:SPFavoritesGroupNameKey]; [dictionary setObject:children forKey:SPFavoriteChildrenKey]; } -- cgit v1.2.3