diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-04 15:17:48 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-04 15:17:48 +0000 |
commit | 1ff1b7dd89dfbea772964f347dd43755b5d7d738 (patch) | |
tree | dafd7bf91368077fe07ff49f259b03c386260e15 /Source/SPPreferenceController.m | |
parent | 313c5bc247548319dc1f93c9ece04ea4326d37e8 (diff) | |
download | sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.tar.gz sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.tar.bz2 sequelpro-1ff1b7dd89dfbea772964f347dd43755b5d7d738.zip |
• replaced the (10.4) deprecated [NSTableView tableView:writeRows:toPasteboard:] method by [NSTableView tableView:writeRowsWithIndexes:toPasteboard:]
• some code cosmetics
Diffstat (limited to 'Source/SPPreferenceController.m')
-rw-r--r-- | Source/SPPreferenceController.m | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/Source/SPPreferenceController.m b/Source/SPPreferenceController.m index 1a2fdf41..ef01ebf7 100644 --- a/Source/SPPreferenceController.m +++ b/Source/SPPreferenceController.m @@ -553,25 +553,19 @@ #pragma mark TableView drag & drop datasource methods // ------------------------------------------------------------------------------- -// tableView:writeRows:toPasteboard: +// tableView:writeRowsWithIndexes:toPasteboard: // ------------------------------------------------------------------------------- -- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard +- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rows toPasteboard:(NSPasteboard*)pboard { - int originalRow; - NSArray *pboardTypes; - + if ([rows count] == 1) { - pboardTypes = [NSArray arrayWithObject:SPFavoritesPasteboardDragType]; - originalRow = [[rows objectAtIndex:0] intValue]; - - [pboard declareTypes:pboardTypes owner:nil]; - [pboard setString:[[NSNumber numberWithInt:originalRow] stringValue] forType:SPFavoritesPasteboardDragType]; - + [pboard declareTypes:[NSArray arrayWithObject:SPFavoritesPasteboardDragType] owner:nil]; + [pboard setString:[[NSNumber numberWithInt:[rows firstIndex]] stringValue] forType:SPFavoritesPasteboardDragType]; return YES; - } - else { + } else { return NO; } + } // ------------------------------------------------------------------------------- |