Skip to content
Snippets Groups Projects
Commit 6e710954 authored by George Nachman's avatar George Nachman
Browse files

Remove deprecated methods

parent 99c21863
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -35,10 +35,10 @@ enum {
return YES;
}
 
- (NSInteger)indexOfTag:(NSInteger)theTag {
- (NSInteger)indexForObject:(id)object {
int i = 0;
for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) {
if ([n intValue] == theTag) {
if ([n isEqual:object]) {
return i;
}
i++;
Loading
Loading
@@ -46,16 +46,16 @@ enum {
return -1;
}
 
- (NSInteger)tagAtIndex:(NSInteger)index {
- (id)objectAtIndex:(NSInteger)index {
int i = 0;
 
for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) {
if (i == index) {
return [n intValue];
return n;
}
i++;
}
return -1;
return nil;
}
 
- (NSDictionary *)menuItemsForPoupupButton
Loading
Loading
@@ -90,7 +90,7 @@ enum {
}
 
- (int)defaultIndex {
return [self indexOfTag:kBounceTriggerParamTagBounceUntilFocus];
return [self indexForObject:@(kBounceTriggerParamTagBounceUntilFocus)];
}
 
@end
Loading
Loading
@@ -174,7 +174,7 @@ enum {
return [NSArray arrayWithObjects:fgbg, fg, bg, nil];
}
 
- (NSInteger)indexOfTag:(NSInteger)theTag {
- (NSInteger)indexForObject:(id)object {
int i = 0;
BOOL isFirst = YES;
for (NSDictionary *dict in [self groupedMenuItemsForPopupButton]) {
Loading
Loading
@@ -183,7 +183,7 @@ enum {
}
isFirst = NO;
for (NSNumber *n in [self objectsSortedByValueInDict:dict]) {
if ([n intValue] == theTag) {
if ([n isEqual:object]) {
return i;
}
i++;
Loading
Loading
@@ -192,7 +192,7 @@ enum {
return -1;
}
 
- (NSInteger)tagAtIndex:(NSInteger)theIndex {
- (id)objectAtIndex:(NSInteger)theIndex {
int i = 0;
BOOL isFirst = YES;
for (NSDictionary *dict in [self groupedMenuItemsForPopupButton]) {
Loading
Loading
@@ -202,12 +202,12 @@ enum {
isFirst = NO;
for (NSNumber *n in [self objectsSortedByValueInDict:dict]) {
if (i == theIndex) {
return [n intValue];
return n;
}
i++;
}
}
return -1;
return nil;
}
 
- (NSDictionary *)dictionaryWithForegroundColor:(NSColor *)foreground
Loading
Loading
Loading
Loading
@@ -34,10 +34,10 @@ typedef enum {
return YES;
}
 
- (NSInteger)indexOfTag:(NSInteger)theTag {
- (NSInteger)indexForObject:(id)object {
int i = 0;
for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) {
if ([n intValue] == theTag) {
if ([n isEqual:object]) {
return i;
}
i++;
Loading
Loading
@@ -45,16 +45,16 @@ typedef enum {
return -1;
}
 
- (NSInteger)tagAtIndex:(NSInteger)index {
- (id)objectAtIndex:(NSInteger)index {
int i = 0;
 
for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) {
if (i == index) {
return [n intValue];
return n;
}
i++;
}
return -1;
return nil;
}
 
- (NSDictionary *)menuItemsForPoupupButton
Loading
Loading
@@ -82,7 +82,7 @@ typedef enum {
}
 
- (int)defaultIndex {
return [self indexOfTag:kMarkTriggerParamTagKeepScrolling];
return [self indexForObject:@(kMarkTriggerParamTagKeepScrolling)];
}
 
@end
Loading
Loading
@@ -42,13 +42,6 @@ extern NSString * const kTriggerPartialLineKey;
// Returns an array of NSDictionaries mapping NSNumber(tag) -> NSString(title)
- (NSArray *)groupedMenuItemsForPopupButton;
 
// Index of "tag" in menu; inverse of tagAtIndex.
// Deprecated
- (NSInteger)indexOfTag:(NSInteger)theTag DEPRECATED_ATTRIBUTE;
// Tag at "index" in menu.
// Deprecated
- (NSInteger)tagAtIndex:(NSInteger)index DEPRECATED_ATTRIBUTE;
// Index of represented object (usually a NSNumber tag, but could be something else)
- (NSInteger)indexForObject:(id)object;
// Represented object (usually a NSNumber tag, but could be something else) at an index.
Loading
Loading
Loading
Loading
@@ -189,27 +189,12 @@ NSString * const kTriggerPartialLineKey = @"partial";
return [[self title] compare:[other title]];
}
 
- (NSInteger)indexOfTag:(NSInteger)theTag
{
return theTag;
}
- (NSInteger)tagAtIndex:(NSInteger)theIndex
{
return 0;
}
- (NSInteger)indexForObject:(id)object {
return [self indexOfTag:[object intValue]];
return [object intValue];
}
 
- (id)objectAtIndex:(NSInteger)index {
int tag = [self tagAtIndex:index];
if (tag < 0) {
return nil;
} else {
return @(tag);
}
return @(index);
}
 
- (NSArray *)objectsSortedByValueInDict:(NSDictionary *)dict
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment