diff options
author | stuconnolly <stuart02@gmail.com> | 2010-12-05 19:00:55 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2010-12-05 19:00:55 +0000 |
commit | e1abafb0d9401c3b62c762921362effabe14f844 (patch) | |
tree | 3739bb4d11acfc5e29173d6db4e17736e711e71e | |
parent | 0dcf7859fbaf5dbb1e1a2887e46add5634d26d77 (diff) | |
download | sequelpro-e1abafb0d9401c3b62c762921362effabe14f844.tar.gz sequelpro-e1abafb0d9401c3b62c762921362effabe14f844.tar.bz2 sequelpro-e1abafb0d9401c3b62c762921362effabe14f844.zip |
Add description methods to tree node classes to aid debugging.
-rw-r--r-- | Source/SPConnectionControllerDelegate.m | 18 | ||||
-rw-r--r-- | Source/SPFavoriteNode.m | 9 | ||||
-rw-r--r-- | Source/SPGroupNode.m | 8 |
3 files changed, 24 insertions, 11 deletions
diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index 8e2e03b2..9094c6cc 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -101,9 +101,7 @@ // Get the node that was renamed SPTreeNode *node = [self selectedFavoriteNode]; - if (![node isGroup]) { - //[[[node representedObject] nodeFavorite] setObject:newName forKey:SPFavoriteNameKey]; - + if (![node isGroup]) { // Updating the name triggers a KVO update [self setName:newName]; @@ -124,9 +122,7 @@ #pragma mark Outline view delegate methods - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item -{ - NSLog(@"%@", [(SPTreeNode *)item representedObject]); - +{ return ([[(SPTreeNode *)item parentNode] parentNode] == nil); } @@ -192,7 +188,7 @@ #pragma mark - #pragma mark Outline view drag & drop -- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard +/*- (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard { [pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:self]; [pboard setData:[NSData data] forType:SPFavoritesPasteboardDragType]; @@ -220,7 +216,7 @@ if ((!item) || ([info draggingSource] != outlineView)) return acceptedDrop; SPTreeNode *node = (item) ? item : [[[[favoritesRoot childNodes] objectAtIndex:0] childNodes] objectAtIndex:0]; - + // TODO: Fix me, disable automatic sorting // Disable all automatic sorting @@ -234,10 +230,10 @@ //[favorites sortUsingDescriptors:[NSArray array]]; // Uncheck sort by menu items - /*for (NSMenuItem *menuItem in [[favoritesSortByMenuItem submenu] itemArray]) + for (NSMenuItem *menuItem in [[favoritesSortByMenuItem submenu] itemArray]) { [menuItem setState:NSOffState]; - }*/ + } NSArray *nodes = [self selectedFavoriteNodes]; @@ -292,7 +288,7 @@ acceptedDrop = YES; return acceptedDrop; -} +}*/ #pragma mark - #pragma mark Textfield delegate methods diff --git a/Source/SPFavoriteNode.m b/Source/SPFavoriteNode.m index 5c0d14c8..55a44653 100644 --- a/Source/SPFavoriteNode.m +++ b/Source/SPFavoriteNode.m @@ -67,6 +67,15 @@ return node; } + +#pragma mark - +#pragma mark Other + +- (NSString *)description +{ + return [NSString stringWithFormat:@"<%@: %p ('%@')>", [self className], self, [[self nodeFavorite] objectForKey:SPFavoriteNameKey]]; +} + #pragma mark - - (void)dealloc diff --git a/Source/SPGroupNode.m b/Source/SPGroupNode.m index 79c65c94..6687b29e 100644 --- a/Source/SPGroupNode.m +++ b/Source/SPGroupNode.m @@ -68,6 +68,14 @@ } #pragma mark - +#pragma mark Other + +- (NSString *)description +{ + return [NSString stringWithFormat:@"<%@: %p ('%@')>", [self className], self, [self nodeName]]; +} + +#pragma mark - - (void)dealloc { |