Skip to content

Commit

Permalink
Convert more interfaces to use properties.
Browse files Browse the repository at this point in the history
Use DEPRECATED_ATTRIBUTE to mark functions deprecated in the comments.
  • Loading branch information
MaddTheSane committed Oct 10, 2015
1 parent 585dd7e commit df51dbc
Show file tree
Hide file tree
Showing 162 changed files with 254 additions and 262 deletions.
2 changes: 1 addition & 1 deletion sources/AdvancedWorkingDirectoryWindowController.m
Expand Up @@ -24,7 +24,7 @@ @implementation AdvancedWorkingDirectoryWindowController {
IBOutlet NSTextField* _paneDirectory;
}

- (id)init {
- (instancetype)init {
return [super initWithWindowNibName:@"AdvancedWorkingDirectoryWindow"];
}

Expand Down
2 changes: 1 addition & 1 deletion sources/AsyncHostLookupController.m
Expand Up @@ -31,7 +31,7 @@ + (instancetype)sharedInstance {
return instance;
}

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_queue = dispatch_queue_create("AsyncHostLookupControllerQueue", NULL);
Expand Down
2 changes: 1 addition & 1 deletion sources/Autocomplete.m
Expand Up @@ -70,7 +70,7 @@ + (int)maxOptions
return [iTermAdvancedSettingsModel autocompleteMaxOptions];
}

- (id)init
- (instancetype)init
{
const int kMaxOptions = [AutocompleteView maxOptions];
self = [super initWithWindowNibName:@"Autocomplete"
Expand Down
4 changes: 2 additions & 2 deletions sources/BounceTrigger.m
Expand Up @@ -35,7 +35,7 @@ - (BOOL)paramIsPopupButton
return YES;
}

- (int)indexOfTag:(int)theTag
- (NSInteger)indexOfTag:(NSInteger)theTag
{
int i = 0;
for (NSNumber *n in [self objectsSortedByValueInDict:[self menuItemsForPoupupButton]]) {
Expand All @@ -47,7 +47,7 @@ - (int)indexOfTag:(int)theTag
return -1;
}

- (int)tagAtIndex:(int)index
- (NSInteger)tagAtIndex:(NSInteger)index
{
int i = 0;

Expand Down
2 changes: 1 addition & 1 deletion sources/BulkCopyProfilePreferencesWindowController.m
Expand Up @@ -37,7 +37,7 @@ @implementation BulkCopyProfilePreferencesWindowController {
IBOutlet NSButton *_copyButton;
}

- (id)init {
- (instancetype)init {
return [super initWithWindowNibName:@"BulkCopyProfilePreferences"];
}

Expand Down
2 changes: 1 addition & 1 deletion sources/CharacterRun.m
Expand Up @@ -15,7 +15,7 @@ + (CRunStorage *)cRunStorageWithCapacity:(int)capacity {
return [[[CRunStorage alloc] initWithCapacity:capacity] autorelease];
}

- (id)initWithCapacity:(int)capacity {
- (instancetype)initWithCapacity:(int)capacity {
self = [super init];
if (self) {
capacity = MAX(capacity, 1);
Expand Down
2 changes: 1 addition & 1 deletion sources/CommandHistory.m
Expand Up @@ -40,7 +40,7 @@ + (instancetype)sharedInstance {
return instance;
}

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_hosts = [[NSMutableDictionary alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion sources/CommandHistoryEntry.m
Expand Up @@ -39,7 +39,7 @@ + (instancetype)entryWithDictionary:(NSDictionary *)dict {
return entry;
}

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_commandUses = [[NSMutableArray alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion sources/CommandHistoryPopup.m
Expand Up @@ -27,7 +27,7 @@ @implementation CommandHistoryPopupWindowController {
int _partialCommandLength;
}

- (id)init
- (instancetype)init
{
self = [super initWithWindowNibName:@"CommandHistoryPopup"
tablePtr:nil
Expand Down
2 changes: 1 addition & 1 deletion sources/ContextMenuActionPrefsController.m
Expand Up @@ -20,7 +20,7 @@ @implementation ContextMenuActionPrefsController
@synthesize delegate = delegate_;
@synthesize hasSelection = hasSelection_;

- (id)initWithWindow:(NSWindow *)window
- (instancetype)initWithWindow:(NSWindow *)window
{
self = [super initWithWindow:window];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/Coprocess.m
Expand Up @@ -121,7 +121,7 @@ + (Coprocess *)coprocessWithPid:(pid_t)pid
return result;
}

- (id)init
- (instancetype)init
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/DVR.m
Expand Up @@ -33,7 +33,7 @@

@implementation DVR

- (id)initWithBufferCapacity:(int)bytes
- (instancetype)initWithBufferCapacity:(int)bytes
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/DVRBuffer.m
Expand Up @@ -31,7 +31,7 @@

@implementation DVRBuffer

- (id)initWithBufferCapacity:(long long)maxsize
- (instancetype)initWithBufferCapacity:(long long)maxsize
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/DVRDecoder.m
Expand Up @@ -44,7 +44,7 @@ - (void)_loadDiffFrameWithKey:(long long)key;

@implementation DVRDecoder

- (id)initWithBuffer:(DVRBuffer*)buffer
- (instancetype)initWithBuffer:(DVRBuffer*)buffer
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/DVREncoder.m
Expand Up @@ -63,7 +63,7 @@ - (int)_computeDiff:(NSArray *)frameLines length:(int)length dest:(char*)scratch

@implementation DVREncoder

- (id)initWithBuffer:(DVRBuffer*)buffer
- (instancetype)initWithBuffer:(DVRBuffer*)buffer
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/DirectoriesPopup.m
Expand Up @@ -25,7 +25,7 @@ @implementation DirectoriesPopupWindowController {
IBOutlet NSTableColumn *_mainColumn;
}

- (id)init {
- (instancetype)init {
self = [super initWithWindowNibName:@"DirectoriesPopup"
tablePtr:nil
model:[[[PopupModel alloc] init] autorelease]];
Expand Down
2 changes: 1 addition & 1 deletion sources/EquivalenceClassSet.m
Expand Up @@ -2,7 +2,7 @@

@implementation EquivalenceClassSet

- (id)init
- (instancetype)init
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/FakeWindow.m
Expand Up @@ -32,7 +32,7 @@

@implementation FakeWindow

- (id)initFromRealWindow:(NSWindowController<iTermWindowController> *)aTerm
- (instancetype)initFromRealWindow:(NSWindowController<iTermWindowController> *)aTerm
session:(PTYSession*)aSession
{
self = [super init];
Expand Down
2 changes: 1 addition & 1 deletion sources/FileTransferManager.m
Expand Up @@ -32,7 +32,7 @@ + (instancetype)sharedInstance {
return instance;
}

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_files = [[NSMutableArray alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion sources/FindContext.m
Expand Up @@ -25,7 +25,7 @@ @implementation FindContext
@synthesize hasWrapped = hasWrapped_;
@synthesize maxTime = maxTime_;

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
maxTime_ = kDefaultMaxTime;
Expand Down
2 changes: 1 addition & 1 deletion sources/FindView.m
Expand Up @@ -31,7 +31,7 @@

@implementation FindView

- (id)initWithFrame:(NSRect)frame {
- (instancetype)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code here.
Expand Down
10 changes: 5 additions & 5 deletions sources/FindViewController.m
Expand Up @@ -55,23 +55,23 @@ @implementation iTermSearchFieldCell {
BOOL _needsAnimation;
}

- (id)initTextCell:(NSString *)aString {
- (instancetype)initTextCell:(NSString *)aString {
self = [super initTextCell:aString];
if (self) {
_alphaMultiplier = 1;
}
return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if (self) {
_alphaMultiplier = 1;
}
return self;
}

- (id)initImageCell:(NSImage *)image {
- (instancetype)initImageCell:(NSImage *)image {
self = [super initImageCell:image];
if (self) {
_alphaMultiplier = 1;
Expand Down Expand Up @@ -268,7 +268,7 @@ @interface FindState : NSObject

@implementation FindState

- (id)init {
- (instancetype)init {
self = [super init];
if (self) {
_string = [@"" retain];
Expand Down Expand Up @@ -332,7 +332,7 @@ + (void)initialize
gDefaultRegex = [[NSUserDefaults standardUserDefaults] boolForKey:@"findRegex_iTerm"];
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
previousFindString_ = [[NSMutableString alloc] init];
Expand Down
2 changes: 1 addition & 1 deletion sources/FontSizeEstimator.m
Expand Up @@ -33,7 +33,7 @@ @implementation FontSizeEstimator
@synthesize size;
@synthesize baseline;

- (id)initWithSize:(NSSize)s baseline:(double)b
- (instancetype)initWithSize:(NSSize)s baseline:(double)b
{
self = [super init];
if (self) {
Expand Down
10 changes: 5 additions & 5 deletions sources/GTMCarbonEvent.m
Expand Up @@ -35,7 +35,7 @@ @interface GTMCarbonHotKey ()
// whenPressed - do we do it on key down or key up?
// Returns:
// a hotkey record, or nil on failure
- (id)initWithHotKey:(EventHotKeyID)keyID
- (instancetype)initWithHotKey:(EventHotKeyID)keyID
target:(id)target
action:(SEL)selector
userInfo:(id)userInfo
Expand Down Expand Up @@ -93,7 +93,7 @@ + (id)currentEvent {
// Returns:
// GTMCarbonEvent
//
- (id)initWithClass:(UInt32)inClass kind:(UInt32)kind {
- (instancetype)initWithClass:(UInt32)inClass kind:(UInt32)kind {
if ((self = [super init])) {
verify_noerr(CreateEvent(kCFAllocatorDefault, inClass, kind,
0, kEventAttributeNone, &event_));
Expand All @@ -107,7 +107,7 @@ - (id)initWithClass:(UInt32)inClass kind:(UInt32)kind {
// Returns:
// GTMCarbonEvent
//
- (id)initWithEvent:(EventRef)event {
- (instancetype)initWithEvent:(EventRef)event {
if ((self = [super init])) {
if (event) {
event_ = RetainEvent(event);
Expand Down Expand Up @@ -519,7 +519,7 @@ @implementation GTMCarbonEventDispatcherHandler
// to keep track of the hotkeys and commands that we handle.
// Returns:
// GTMCarbonApplication or nil on failure
- (id)init {
- (instancetype)init {
if ((self = [super init])) {
static EventTypeSpec events[] = {
{ kEventClassKeyboard, kEventHotKeyPressed },
Expand Down Expand Up @@ -668,7 +668,7 @@ @implementation GTMCarbonHotKey
// whenPressed - do we do it on key down or key up?
// Returns:
// a hotkey record, or nil on failure
- (id)initWithHotKey:(EventHotKeyID)keyID
- (instancetype)initWithHotKey:(EventHotKeyID)keyID
target:(id)target
action:(SEL)selector
userInfo:(id)userInfo
Expand Down
2 changes: 1 addition & 1 deletion sources/GeneralPreferencesViewController.m
Expand Up @@ -108,7 +108,7 @@ @implementation GeneralPreferencesViewController {
IBOutlet NSButton *_autoHideTmuxClientSession;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
[[NSNotificationCenter defaultCenter] addObserver:self
Expand Down
10 changes: 5 additions & 5 deletions sources/GlobalSearch.m
Expand Up @@ -61,7 +61,7 @@ @interface GlobalSearchInstance : NSObject
NSMutableSet* matchLocations_;
}

- (id)initWithSession:(PTYSession *)session
- (instancetype)initWithSession:(PTYSession *)session
findString:(NSString*)findString
label:(NSString*)label;
- (BOOL)more;
Expand All @@ -83,7 +83,7 @@ @interface GlobalSearchResult : NSObject
long long absEndY_;
}

- (id)initWithInstance:(GlobalSearchInstance*)instance context:(NSString*)theContext x:(int)x absY:(long long)absY endX:(int)endX y:(long long)absEndY findString:(NSString*)findString;
- (instancetype)initWithInstance:(GlobalSearchInstance*)instance context:(NSString*)theContext x:(int)x absY:(long long)absY endX:(int)endX y:(long long)absEndY findString:(NSString*)findString;
- (NSString*)context;
- (NSString*)findString;
- (GlobalSearchInstance*)instance;
Expand All @@ -99,7 +99,7 @@ - (int)endY;

@implementation GlobalSearchResult

- (id)initWithInstance:(GlobalSearchInstance*)instance
- (instancetype)initWithInstance:(GlobalSearchInstance*)instance
context:(NSString*)theContext
x:(int)x
absY:(long long)absY
Expand Down Expand Up @@ -180,7 +180,7 @@ - (int)endY

@implementation GlobalSearchInstance

- (id)initWithSession:(PTYSession *)session
- (instancetype)initWithSession:(PTYSession *)session
findString:(NSString*)findString
label:(NSString*)label
{
Expand Down Expand Up @@ -354,7 +354,7 @@ - (void)awakeFromNib
}
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
Expand Down
4 changes: 2 additions & 2 deletions sources/HighlightTrigger.m
Expand Up @@ -174,7 +174,7 @@ - (NSArray *)groupedMenuItemsForPopupButton {
return [NSArray arrayWithObjects:fgbg, fg, bg, nil];
}

- (int)indexOfTag:(int)theTag
- (NSInteger)indexOfTag:(NSInteger)theTag
{
int i = 0;
BOOL isFirst = YES;
Expand All @@ -193,7 +193,7 @@ - (int)indexOfTag:(int)theTag
return -1;
}

- (int)tagAtIndex:(int)theIndex
- (NSInteger)tagAtIndex:(NSInteger)theIndex
{
int i = 0;
BOOL isFirst = YES;
Expand Down
2 changes: 1 addition & 1 deletion sources/ITAddressBookMgr.m
Expand Up @@ -63,7 +63,7 @@ + (id)sharedInstance
return shared;
}

- (id)init
- (instancetype)init
{
self = [super init];
if (self) {
Expand Down
2 changes: 1 addition & 1 deletion sources/IntervalMap.m
Expand Up @@ -123,7 +123,7 @@ - (NSString *)description

@implementation IntervalMap

- (id)init
- (instancetype)init
{
self = [super init];
if (self) {
Expand Down

0 comments on commit df51dbc

Please sign in to comment.