Skip to content

Commit

Permalink
Get rid of some unnecessary casts
Browse files Browse the repository at this point in the history
  • Loading branch information
d0k authored and pieter committed May 27, 2009
1 parent df4a50a commit c12e8b9
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
4 changes: 2 additions & 2 deletions PBCLIProxy.mm
Expand Up @@ -53,11 +53,11 @@ - (BOOL)openRepository:(NSURL*)repositoryPath arguments: (NSArray*) args error:(

if ([arguments count] > 0 && ([[arguments objectAtIndex:0] isEqualToString:@"--commit"] ||
[[arguments objectAtIndex:0] isEqualToString:@"-c"]))
[((PBGitWindowController *)document.windowController) showCommitView:self];
[document.windowController showCommitView:self];
else {
PBGitRevSpecifier* rev = [[PBGitRevSpecifier alloc] initWithParameters:arguments];
document.currentBranch = [document addBranch: rev];
[(PBGitWindowController *)document.windowController showHistoryView:self];
[document.windowController showHistoryView:self];
}
[NSApp activateIgnoringOtherApps:YES];

Expand Down
4 changes: 3 additions & 1 deletion PBCommitList.h
Expand Up @@ -10,9 +10,11 @@
#import <WebKit/WebView.h>
#import "PBGitHistoryController.h"

@class PBWebHistoryController;

@interface PBCommitList : NSTableView {
IBOutlet WebView* webView;
IBOutlet id webController;
IBOutlet PBWebHistoryController *webController;
IBOutlet PBGitHistoryController *controller;

NSPoint mouseDownPoint;
Expand Down
2 changes: 1 addition & 1 deletion PBCommitList.m
Expand Up @@ -30,7 +30,7 @@ - (void) keyDown: (id) event
[webView scrollPageDown: self];
}
else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jkcv"]].location == 0)
[((PBWebHistoryController *)webController) sendKey: character];
[webController sendKey: character];
else
[super keyDown: event];
}
Expand Down
2 changes: 1 addition & 1 deletion PBFileChangesTableView.m
Expand Up @@ -15,7 +15,7 @@ @implementation PBFileChangesTableView
- (NSMenu *)menuForEvent:(NSEvent *)theEvent
{
if ([self delegate])
return [(PBGitIndexController *)[self delegate] menuForTable: self];
return [[self delegate] menuForTable: self];

return nil;
}
Expand Down
6 changes: 4 additions & 2 deletions PBGitCommitController.h
Expand Up @@ -9,7 +9,9 @@
#import <Cocoa/Cocoa.h>
#import "PBViewController.h"

@class PBGitIndexController;
@class PBIconAndTextCell;
@class PBWebChangesController;

@interface PBGitCommitController : PBViewController {
NSMutableArray *files;
Expand All @@ -18,8 +20,8 @@
IBOutlet NSArrayController *unstagedFilesController;
IBOutlet NSArrayController *cachedFilesController;

IBOutlet id indexController;
IBOutlet id webController;
IBOutlet PBGitIndexController *indexController;
IBOutlet PBWebChangesController *webController;

NSString *status;

Expand Down
6 changes: 3 additions & 3 deletions PBGitCommitController.m
Expand Up @@ -34,7 +34,7 @@ - (void)awakeFromNib
}
- (void) removeView
{
[(PBWebChangesController *)webController closeView];
[webController closeView];
[super finalize];
}

Expand Down Expand Up @@ -325,8 +325,8 @@ - (IBAction) commit:(id) sender
if (ret)
return [self commitFailedBecause:@"Could not update HEAD"];

[(PBWebChangesController *)webController setStateMessage:[NSString stringWithFormat:@"Successfully created commit %@", commit]];
[webController setStateMessage:[NSString stringWithFormat:@"Successfully created commit %@", commit]];

repository.hasChanged = YES;
self.busy--;
[commitMessageView setString:@""];
Expand Down
4 changes: 3 additions & 1 deletion PBGitRepository.h
Expand Up @@ -13,6 +13,8 @@

extern NSString* PBGitRepositoryErrorDomain;

@class PBGitWindowController;

@interface PBGitRepository : NSDocument {
PBGitRevList* revisionList;
PBGitConfig *config;
Expand Down Expand Up @@ -58,7 +60,7 @@ extern NSString* PBGitRepositoryErrorDomain;
- (void) setup;

@property (assign) BOOL hasChanged;
@property (readonly) NSWindowController *windowController;
@property (readonly) PBGitWindowController *windowController;
@property (readonly) PBGitConfig *config;
@property (retain) PBGitRevList* revisionList;
@property (assign) NSMutableArray* branches;
Expand Down
2 changes: 1 addition & 1 deletion PBGitRepository.m
Expand Up @@ -174,7 +174,7 @@ - (void)makeWindowControllers
#endif
}

- (NSWindowController *)windowController
- (PBGitWindowController *)windowController
{
if ([[self windowControllers] count] == 0)
return NULL;
Expand Down

0 comments on commit c12e8b9

Please sign in to comment.