From 9131db394c46f10260fcec1a1df5216b140e2bc2 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Wed, 9 May 2012 11:54:15 +0000 Subject: Fix gcc warnings. --- Source/SPConnectionControllerDataSource.m | 4 ++-- Source/SPConnectionControllerDelegate.m | 20 ++++++++++---------- Source/SPDatabaseStructure.m | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/SPConnectionControllerDataSource.m b/Source/SPConnectionControllerDataSource.m index 91fd6398..e7fea0c6 100644 --- a/Source/SPConnectionControllerDataSource.m +++ b/Source/SPConnectionControllerDataSource.m @@ -45,11 +45,11 @@ return [[node childNodes] count]; } -- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item +- (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)childIndex ofItem:(id)item { SPTreeNode *node = (item == nil ? favoritesRoot : (SPTreeNode *)item); - return NSArrayObjectAtIndex([node childNodes], index); + return NSArrayObjectAtIndex([node childNodes], childIndex); } - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item diff --git a/Source/SPConnectionControllerDelegate.m b/Source/SPConnectionControllerDelegate.m index bc6800c3..35b69aeb 100644 --- a/Source/SPConnectionControllerDelegate.m +++ b/Source/SPConnectionControllerDelegate.m @@ -191,15 +191,15 @@ static NSString *SPDatabaseImage = @"database-small"; return result; } -- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id )info proposedItem:(id)item proposedChildIndex:(NSInteger)index +- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id )info proposedItem:(id)item proposedChildIndex:(NSInteger)childIndex { NSDragOperation result = NSDragOperationNone; // Prevent dropping favorites on other favorites (non-groups) - if ((index == NSOutlineViewDropOnItemIndex) && (![item isGroup])) return result; + if ((childIndex == NSOutlineViewDropOnItemIndex) && (![item isGroup])) return result; if ([info draggingSource] == outlineView) { - [outlineView setDropItem:item dropChildIndex:index]; + [outlineView setDropItem:item dropChildIndex:childIndex]; result = NSDragOperationMove; } @@ -207,7 +207,7 @@ static NSString *SPDatabaseImage = @"database-small"; return result; } -- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id )info item:(id)item childIndex:(NSInteger)index +- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id )info item:(id)item childIndex:(NSInteger)childIndex { BOOL acceptedDrop = NO; @@ -231,13 +231,13 @@ static NSString *SPDatabaseImage = @"database-small"; if (![draggedNodes count]) return acceptedDrop; if ([node isGroup]) { - if (index == NSOutlineViewDropOnItemIndex) { - index = 0; + if (childIndex == NSOutlineViewDropOnItemIndex) { + childIndex = 0; } } else { - if (index == NSOutlineViewDropOnItemIndex) { - index = 0; + if (childIndex == NSOutlineViewDropOnItemIndex) { + childIndex = 0; } } @@ -251,13 +251,13 @@ static NSString *SPDatabaseImage = @"database-small"; { // Remove the node from its old location NSInteger oldIndex = [childNodeArray indexOfObject:treeNode]; - NSInteger newIndex = index; + NSInteger newIndex = childIndex; if (oldIndex != NSNotFound) { [childNodeArray removeObjectAtIndex:oldIndex]; - if (index > oldIndex) { + if (childIndex > oldIndex) { newIndex--; } } diff --git a/Source/SPDatabaseStructure.m b/Source/SPDatabaseStructure.m index 79e2cc5d..095a51c1 100644 --- a/Source/SPDatabaseStructure.m +++ b/Source/SPDatabaseStructure.m @@ -650,4 +650,4 @@ return YES; } -@end \ No newline at end of file +@end -- cgit v1.2.3