Permalink
Browse files

Fix "Duplicate declaration of method" error when using LLVM

The class method and the instance method had different types for the window controller. The instance method should be using the NSWindowController since the sheet can be shown in a non PBGitWindowController window (the PBCloneRepositoryPanel).
  • Loading branch information...
1 parent f254fd1 commit 07651211fd8e58742984c9aa15aad5fbc08208c1 @brotherbard committed Jul 25, 2010
Showing with 10 additions and 9 deletions.
  1. +2 −3 PBRemoteProgressSheet.h
  2. +8 −6 PBRemoteProgressSheet.m
View
@@ -17,10 +17,9 @@ extern NSString * const kGitXProgressErrorInfo;
@class PBGitRepository;
-@class PBGitWindowController;
@interface PBRemoteProgressSheet : NSWindowController {
- PBGitWindowController *controller;
+ NSWindowController *controller;
NSArray *arguments;
NSString *title;
@@ -37,7 +36,7 @@ extern NSString * const kGitXProgressErrorInfo;
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController;
-+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo;
++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo;
@property (assign) IBOutlet NSTextField *progressDescription;
View
@@ -24,7 +24,7 @@
@interface PBRemoteProgressSheet ()
-- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)controller;
+- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController;
- (void) showSuccessMessage;
- (void) showErrorMessage;
@@ -52,7 +52,7 @@ @implementation PBRemoteProgressSheet
#pragma mark -
#pragma mark PBRemoteProgressSheet
-+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController
++ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController
{
PBRemoteProgressSheet *sheet = [[self alloc] initWithWindowNibName:@"PBRemoteProgressSheet"];
[sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:dir windowController:windowController];
@@ -65,7 +65,7 @@ + (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)
}
-- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController
+- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController
{
controller = windowController;
arguments = args;
@@ -120,7 +120,7 @@ - (void) taskCompleted:(NSNotification *)notification
[self showSuccessMessage];
if ([controller respondsToSelector:@selector(repository)])
- [controller.repository reloadRefs];
+ [[(PBGitWindowController *)controller repository] reloadRefs];
}
@@ -146,7 +146,8 @@ - (void) showSuccessMessage
[info appendString:[self commandDescription]];
[info appendString:[self standardOutputDescription]];
- [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info];
+ if ([controller respondsToSelector:@selector(showMessageSheet:infoText:)])
+ [(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info];
}
@@ -164,7 +165,8 @@ - (void) showErrorMessage
nil];
NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:errorUserInfo];
- [(PBGitWindowController *)controller showErrorSheet:error];
+ if ([controller respondsToSelector:@selector(showErrorSheet:)])
+ [(PBGitWindowController *)controller showErrorSheet:error];
}

0 comments on commit 0765121

Please sign in to comment.