Browse files

Get rid of some unnecessary casts

  • Loading branch information...
1 parent df4a50a commit c12e8b9dd4aa215dea40705bffeba14f808de8b0 @d0k d0k committed with May 20, 2009
Showing with 18 additions and 12 deletions.
  1. +2 −2 PBCLIProxy.mm
  2. +3 −1 PBCommitList.h
  3. +1 −1 PBCommitList.m
  4. +1 −1 PBFileChangesTableView.m
  5. +4 −2 PBGitCommitController.h
  6. +3 −3 PBGitCommitController.m
  7. +3 −1 PBGitRepository.h
  8. +1 −1 PBGitRepository.m
View
4 PBCLIProxy.mm
@@ -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];
View
4 PBCommitList.h
@@ -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;
View
2 PBCommitList.m
@@ -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];
}
View
2 PBFileChangesTableView.m
@@ -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;
}
View
6 PBGitCommitController.h
@@ -9,7 +9,9 @@
#import <Cocoa/Cocoa.h>
#import "PBViewController.h"
+@class PBGitIndexController;
@class PBIconAndTextCell;
+@class PBWebChangesController;
@interface PBGitCommitController : PBViewController {
NSMutableArray *files;
@@ -18,8 +20,8 @@
IBOutlet NSArrayController *unstagedFilesController;
IBOutlet NSArrayController *cachedFilesController;
- IBOutlet id indexController;
- IBOutlet id webController;
+ IBOutlet PBGitIndexController *indexController;
+ IBOutlet PBWebChangesController *webController;
NSString *status;
View
6 PBGitCommitController.m
@@ -34,7 +34,7 @@ - (void)awakeFromNib
}
- (void) removeView
{
- [(PBWebChangesController *)webController closeView];
+ [webController closeView];
[super finalize];
}
@@ -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:@""];
View
4 PBGitRepository.h
@@ -13,6 +13,8 @@
extern NSString* PBGitRepositoryErrorDomain;
+@class PBGitWindowController;
+
@interface PBGitRepository : NSDocument {
PBGitRevList* revisionList;
PBGitConfig *config;
@@ -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;
View
2 PBGitRepository.m
@@ -174,7 +174,7 @@ - (void)makeWindowControllers
#endif
}
-- (NSWindowController *)windowController
+- (PBGitWindowController *)windowController
{
if ([[self windowControllers] count] == 0)
return NULL;

0 comments on commit c12e8b9

Please sign in to comment.