adium/adium

6d3dce05d526
Parents a8839ba0ae0a
Children 3f1e5d253f08
Upgrade some deprecated table view functions.
--- a/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m Fri Apr 27 00:45:36 2012 -0400
+++ b/Frameworks/AIUtilities Framework/Source/AIVariableHeightOutlineView.m Fri Apr 27 01:13:10 2012 -0400
@@ -390,6 +390,7 @@
}
+//Our default drag image will be cropped incorrectly, so we need a custom one here
- (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset
{
NSImage *image;
@@ -406,24 +407,6 @@
return image;
}
-//Our default drag image will be cropped incorrectly, so we need a custom one here
-- (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset
-{
- NSImage *image;
- NSUInteger i, bufSize = [dragRows count];
- NSUInteger *buf = malloc(bufSize * sizeof(NSUInteger));
-
- for (i = 0; i < bufSize; i++) {
- buf[i] = [[dragRows objectAtIndex:0] unsignedIntValue];
- }
-
- image = [self dragImageForRows:buf count:bufSize tableColumns:nil event:dragEvent offset:dragImageOffset];
-
- free(buf);
-
- return image;
-}
-
- (NSInteger)totalHeight
{
if (totalHeight == -1) {
--- a/Frameworks/Adium Framework/Source/ESPresetManagementController.m Fri Apr 27 00:45:36 2012 -0400
+++ b/Frameworks/Adium Framework/Source/ESPresetManagementController.m Fri Apr 27 01:13:10 2012 -0400
@@ -330,11 +330,11 @@
*
* Only allow the drag to start if the delegate responds to @selector(movePreset:toIndex:inPresets:)
*/
-- (BOOL)tableView:(NSTableView *)tv writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
if ([delegate respondsToSelector:@selector(movePreset:toIndex:inPresets:presetAfterMove:)]) {
[tempDragPreset release];
- tempDragPreset = [[presets objectAtIndex:[[rows objectAtIndex:0] integerValue]] retain];
+ tempDragPreset = [[presets objectAtIndex:[rowIndexes firstIndex]] retain];
[pboard declareTypes:[NSArray arrayWithObject:PRESET_DRAG_TYPE] owner:self];
[pboard setString:@"Preset" forType:PRESET_DRAG_TYPE]; //Arbitrary state
--- a/Plugins/Emoticons/AIEmoticonPackPreviewTableView.m Fri Apr 27 00:45:36 2012 -0400
+++ b/Plugins/Emoticons/AIEmoticonPackPreviewTableView.m Fri Apr 27 01:13:10 2012 -0400
@@ -92,6 +92,7 @@
return [image imageByFadingToFraction:DRAG_IMAGE_FRACTION];
}
+//Our default drag image will be cropped incorrectly, so we need a custom one here
- (NSImage *)dragImageForRowsWithIndexes:(NSIndexSet *)dragRows tableColumns:(NSArray *)tableColumns event:(NSEvent*)dragEvent offset:(NSPointPointer)dragImageOffset
{
NSImage *image;
@@ -108,22 +109,4 @@
return image;
}
-//Our default drag image will be cropped incorrectly, so we need a custom one here
-- (NSImage *)dragImageForRows:(NSArray *)dragRows event:(NSEvent *)dragEvent dragImageOffset:(NSPointPointer)dragImageOffset
-{
- NSImage *image;
- NSUInteger i, bufSize = [dragRows count];
- NSUInteger *buf = malloc(bufSize * sizeof(NSUInteger));
-
- for (i = 0; i < bufSize; i++) {
- buf[i] = [[dragRows objectAtIndex:0] unsignedIntegerValue];
- }
-
- image = [self dragImageForRows:buf count:bufSize tableColumns:nil event:dragEvent offset:dragImageOffset];
-
- free(buf);
-
- return image;
-}
-
@end
--- a/Plugins/Emoticons/AIEmoticonPreferences.h Fri Apr 27 00:45:36 2012 -0400
+++ b/Plugins/Emoticons/AIEmoticonPreferences.h Fri Apr 27 01:13:10 2012 -0400
@@ -33,7 +33,7 @@
AIEmoticonPack *selectedEmoticonPack;
NSMutableDictionary *emoticonImageCache;
- NSArray *dragRows;
+ NSIndexSet *dragRows;
BOOL viewIsOpen;
}
--- a/Plugins/Emoticons/AIEmoticonPreferences.m Fri Apr 27 00:45:36 2012 -0400
+++ b/Plugins/Emoticons/AIEmoticonPreferences.m Fri Apr 27 01:13:10 2012 -0400
@@ -334,12 +334,12 @@
#pragma mark Drag and Drop
-- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
if (tableView != table_emoticonPacks)
return NO;
- dragRows = rows;
+ dragRows = rowIndexes;
[pboard declareTypes:[NSArray arrayWithObject:EMOTICON_PACK_DRAG_TYPE] owner:self];
[pboard setString:@"dragPack" forType:EMOTICON_PACK_DRAG_TYPE];
@@ -366,9 +366,9 @@
//Move
NSMutableArray *movedPacks = [NSMutableArray array]; //Keep track of the packs we've moved
- for (NSNumber *dragRow in dragRows) {
- [movedPacks addObject:[[emoticonPackPreviewControllers objectAtIndex:[dragRow integerValue]] emoticonPack]];
- }
+ [dragRows enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
+ [movedPacks addObject:[[emoticonPackPreviewControllers objectAtIndex:idx] emoticonPack]];
+ }];
[adium.emoticonController moveEmoticonPacks:movedPacks toIndex:row];
[self configurePreviewControllers];
--- a/Source/ESStatusSort.m Fri Apr 27 00:45:36 2012 -0400
+++ b/Source/ESStatusSort.m Fri Apr 27 01:13:10 2012 -0400
@@ -473,14 +473,14 @@
/*!
* @brief Table view write rows
*/
-- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray *)rows toPasteboard:(NSPasteboard *)pboard
+- (BOOL)tableView:(NSTableView *)tableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
[pboard declareTypes:[NSArray arrayWithObject:STATUS_DRAG_TYPE] owner:self];
//Build a list of all the highlighted aways
NSString *dragItem = [self tableView:tableView
objectValueForTableColumn:nil
- row:[[rows objectAtIndex:0] integerValue]];
+ row:[rowIndexes firstIndex]];
//put it on the pasteboard
[pboard setString:dragItem forType:STATUS_DRAG_TYPE];