Changeset 5042
- Timestamp:
- 11/02/07 16:47:18 (9 months ago)
- Files:
-
- WiredClient/trunk/WCPreferences.m (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
WiredClient/trunk/WCPreferences.m
r5015 r5042 585 585 row = [_bookmarksTableView selectedRow]; 586 586 587 if(row >= 0 ) {587 if(row >= 0 && (NSUInteger) row < [[WCSettings objectForKey:WCBookmarks] count]) { 588 588 bookmark = [WCSettings bookmarkAtIndex:row]; 589 589 … … 642 642 row = [_bookmarksTableView selectedRow]; 643 643 644 if(row < 0 )644 if(row < 0 || (NSUInteger) row >= [[WCSettings objectForKey:WCBookmarks] count]) 645 645 return; 646 646 … … 1293 1293 [_bookmarksTableView reloadData]; 1294 1294 1295 row = row == 0 ? 0 : row - 1;1296 1297 if(row != [_bookmarksTableView selectedRow])1298 [_bookmarksTableView selectRow:row byExtendingSelection:NO];1299 else1300 [self _selectBookmark];1301 1302 1295 [[NSNotificationCenter defaultCenter] postNotificationName:WCBookmarksDidChange object:self]; 1303 1296 } … … 1324 1317 [WCSettings addHighlight:highlight]; 1325 1318 1319 row = [[WCSettings objectForKey:WCHighlights] count] - 1; 1320 1326 1321 [_highlightsTableView reloadData]; 1327 [_highlightsTableView selectRow: [[WCSettings objectForKey:WCHighlights] count] - 11328 byExtendingSelection:NO];1322 [_highlightsTableView selectRow:row byExtendingSelection:NO]; 1323 [_highlightsTableView editColumn:0 row:row withEvent:NULL select:YES]; 1329 1324 } 1330 1325 … … 1358 1353 1359 1354 [_highlightsTableView reloadData]; 1360 [_highlightsTableView selectRow:row == 0 ? 0 : row - 1 byExtendingSelection:NO];1361 1355 } 1362 1356 } … … 1366 1360 - (IBAction)addIgnore:(id)sender { 1367 1361 NSDictionary *ignore; 1362 NSInteger row; 1368 1363 1369 1364 ignore = [NSDictionary dictionaryWithObjectsAndKeys: … … 1374 1369 [WCSettings addIgnore:ignore]; 1375 1370 1371 row = [[WCSettings objectForKey:WCIgnores] count] - 1; 1372 1376 1373 [_ignoresTableView reloadData]; 1377 [_ignoresTableView selectRow: [[WCSettings objectForKey:WCIgnores] count] - 11378 byExtendingSelection:NO];1374 [_ignoresTableView selectRow:row byExtendingSelection:NO]; 1375 [_ignoresTableView editColumn:0 row:row withEvent:NULL select:YES]; 1379 1376 } 1380 1377 … … 1406 1403 1407 1404 [WCSettings removeIgnoreAtIndex:row]; 1408 1409 1405 [_ignoresTableView reloadData]; 1410 [_ignoresTableView selectRow:row == 0 ? 0 : row - 1 byExtendingSelection:NO];1411 1406 } 1412 1407 } … … 1542 1537 1543 1538 if(tableView == _highlightsTableView) { 1544 dictionary = [[WCSettings highlightAtIndex:row] mutableCopy]; 1545 1546 if(tableColumn == _highlightsPatternTableColumn) 1547 [dictionary setObject:object forKey:WCHighlightsPattern]; 1548 1549 [WCSettings setHighlight:dictionary atIndex:row]; 1550 [dictionary release]; 1539 if((NSUInteger) row < [[WCSettings objectForKey:WCHighlights] count]) { 1540 dictionary = [[WCSettings highlightAtIndex:row] mutableCopy]; 1541 1542 if(tableColumn == _highlightsPatternTableColumn) 1543 [dictionary setObject:object forKey:WCHighlightsPattern]; 1544 1545 [WCSettings setHighlight:dictionary atIndex:row]; 1546 [dictionary release]; 1547 } 1551 1548 } 1552 1549 else if(tableView == _ignoresTableView) { 1553 dictionary = [[WCSettings ignoreAtIndex:row] mutableCopy]; 1554 1555 if(tableColumn == _ignoresNickTableColumn) 1556 [dictionary setObject:object forKey:WCIgnoresNick]; 1557 else if(tableColumn == _ignoresLoginTableColumn) 1558 [dictionary setObject:object forKey:WCIgnoresLogin]; 1559 else if(tableColumn == _ignoresAddressTableColumn) 1560 [dictionary setObject:object forKey:WCIgnoresAddress]; 1561 1562 [WCSettings setIgnore:dictionary atIndex:row]; 1563 [dictionary release]; 1550 if((NSUInteger) row < [[WCSettings objectForKey:WCIgnores] count]) { 1551 dictionary = [[WCSettings ignoreAtIndex:row] mutableCopy]; 1552 1553 if(tableColumn == _ignoresNickTableColumn) 1554 [dictionary setObject:object forKey:WCIgnoresNick]; 1555 else if(tableColumn == _ignoresLoginTableColumn) 1556 [dictionary setObject:object forKey:WCIgnoresLogin]; 1557 else if(tableColumn == _ignoresAddressTableColumn) 1558 [dictionary setObject:object forKey:WCIgnoresAddress]; 1559 1560 [WCSettings setIgnore:dictionary atIndex:row]; 1561 [dictionary release]; 1562 } 1564 1563 } 1565 1564 }
