Skip to content

Commit

Permalink
get rid of deprecated method calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
pweiskircher committed Sep 6, 2009
1 parent b1cb099 commit 8494b7a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions Source/Library/LibrarySubControllerBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ - (void) loadSelectionInformation:(id)data withEntries:(NSArray *)theEntries{
for (int i = 0; i < [theEntries count]; i++) {
int sqlIdentifier = [(id<ThereminEntity>)[theEntries objectAtIndex:i] identifier];
if ([indexes containsIndex:sqlIdentifier] || (selectCompilation == YES && sqlIdentifier == CompilationSQLIdentifier)) {
[mTableView selectRow:[self convertToDisplayIndex:i] byExtendingSelection:!first];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[self convertToDisplayIndex:i]] byExtendingSelection:!first];

if (first == YES) {
[mTableView scrollRowToVisible:[self convertToDisplayIndex:i]];
Expand All @@ -198,7 +198,7 @@ - (void) loadSelectionInformation:(id)data withEntries:(NSArray *)theEntries{
}

if ([indexes count] <= 0 || first == YES) {
[mTableView selectRow:0 byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
[mTableView scrollRowToVisible:0];
}
}
Expand Down Expand Up @@ -259,7 +259,7 @@ - (void) receivedResults:(NSArray *)items {
[mTableView reloadData];

if (!mSelectionData) {
[mTableView selectRow:0 byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
[mTableView scrollRowToVisible:0];
} else
[self loadSelectionInformation:mSelectionData withEntries:mItems];
Expand Down Expand Up @@ -301,7 +301,7 @@ - (void)tableViewSelectionDidChange:(NSNotification *)aNotification {

- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard*)pboard {
if ([rowIndexes count] == 1)
[aTableView selectRow:[rowIndexes firstIndex] byExtendingSelection:NO];
[aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[rowIndexes firstIndex]] byExtendingSelection:NO];

NSArray *uniqueIdentifiers = [mLibraryController selectedSongsUniqueIdentifiersInTable:aTableView];

Expand Down
14 changes: 7 additions & 7 deletions Source/PlayListController.m
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)r
}

if ([rowIndexes count] == 1)
[aTableView selectRow:[rowIndexes firstIndex] byExtendingSelection:NO];
[aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[rowIndexes firstIndex]] byExtendingSelection:NO];

NSData *data = [NSKeyedArchiver archivedDataWithRootObject:rowIndexes];
[pboard declareTypes:[NSArray arrayWithObject:gMpdPlaylistPositionType] owner:self];
Expand Down Expand Up @@ -374,7 +374,7 @@ - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info
while (current_index != NSNotFound)
{
[[mController musicClient] moveSongFromPosition:current_index toPosition:dest];
[aTableView selectRow:dest byExtendingSelection:expandSelection];
[aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:dest] byExtendingSelection:expandSelection];
expandSelection = YES;
dest++;
current_index = [rowIndexes indexGreaterThanIndex: current_index];
Expand All @@ -385,7 +385,7 @@ - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info
{
dest--;
[[mController musicClient] moveSongFromPosition:current_index toPosition:dest];
[aTableView selectRow:dest byExtendingSelection:expandSelection];
[aTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:dest] byExtendingSelection:expandSelection];
expandSelection = YES;
current_index = [rowIndexes indexLessThanIndex: current_index];
}
Expand Down Expand Up @@ -506,7 +506,7 @@ - (void) searchAction:(id)sender {

if ([mTableView acceptsFirstResponder])
[[mController window] makeFirstResponder:mTableView];
[mTableView selectRow:0 byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO];
}
}

Expand Down Expand Up @@ -535,7 +535,7 @@ - (BOOL) showCurrentSong {
- (BOOL) selectCurrentSong {
int row = [self currentSongRow];
if (row != -1) {
[mTableView selectRow:row byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
return YES;
}
return NO;
Expand Down Expand Up @@ -643,11 +643,11 @@ - (IBAction) deleteSelectedSongs:(id)sender {
[[mController musicClient] removeSongsFromPlaylist:array];

if (selectLastRow)
[mTableView selectRow:[mTableView numberOfRows]-2 byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[mTableView numberOfRows]-2] byExtendingSelection:NO];
else {
NSIndexSet *selection = [mTableView selectedRowIndexes];
if ([selection count] > 0)
[mTableView selectRow:[selection firstIndex] byExtendingSelection:NO];
[mTableView selectRowIndexes:[NSIndexSet indexSetWithIndex:[selection firstIndex]] byExtendingSelection:NO];
}
}

Expand Down
6 changes: 3 additions & 3 deletions Source/TableView/PWTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ - (void) selectLiveSearchRow:(NSString *)searchString {
}
}
if (row != -1) {
[self selectRow:row byExtendingSelection:NO];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
[self scrollRowToVisible:row];
}
}
Expand Down Expand Up @@ -206,7 +206,7 @@ - (NSMenu *)menuForEvent:(NSEvent *)theEvent
// figure out if the row that was just clicked on is currently selected
if ([selectedRowIndexes containsIndex:row] == NO)
{
[self selectRow:row byExtendingSelection:NO];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
}
// else that row is currently selected, so don't change anything.

Expand Down Expand Up @@ -318,7 +318,7 @@ - (void) selectAll:(id)sender {
if (mSelectAllSelectsRow == SELECT_ALL_SELECTS_ALL_ROWS)
[super selectAll:sender];
else {
[self selectRow:mSelectAllSelectsRow byExtendingSelection:NO];
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:mSelectAllSelectsRow] byExtendingSelection:NO];
[self scrollRowToVisible:mSelectAllSelectsRow];
}
}
Expand Down

0 comments on commit 8494b7a

Please sign in to comment.