Skip to content

Commit 0765121

Browse files
committed
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).
1 parent f254fd1 commit 0765121

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

PBRemoteProgressSheet.h

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ extern NSString * const kGitXProgressErrorInfo;
1717

1818

1919
@class PBGitRepository;
20-
@class PBGitWindowController;
2120

2221
@interface PBRemoteProgressSheet : NSWindowController {
23-
PBGitWindowController *controller;
22+
NSWindowController *controller;
2423

2524
NSArray *arguments;
2625
NSString *title;
@@ -37,7 +36,7 @@ extern NSString * const kGitXProgressErrorInfo;
3736

3837
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController;
3938

40-
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo;
39+
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inRepository:(PBGitRepository *)repo;
4140

4241

4342
@property (assign) IBOutlet NSTextField *progressDescription;

PBRemoteProgressSheet.m

+8-6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
@interface PBRemoteProgressSheet ()
2626

27-
- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)controller;
27+
- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController;
2828
- (void) showSuccessMessage;
2929
- (void) showErrorMessage;
3030

@@ -52,7 +52,7 @@ @implementation PBRemoteProgressSheet
5252
#pragma mark -
5353
#pragma mark PBRemoteProgressSheet
5454

55-
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController
55+
+ (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController
5656
{
5757
PBRemoteProgressSheet *sheet = [[self alloc] initWithWindowNibName:@"PBRemoteProgressSheet"];
5858
[sheet beginRemoteProgressSheetForArguments:args title:theTitle description:theDescription inDir:dir windowController:windowController];
@@ -65,7 +65,7 @@ + (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)
6565
}
6666

6767

68-
- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(PBGitWindowController *)windowController
68+
- (void) beginRemoteProgressSheetForArguments:(NSArray *)args title:(NSString *)theTitle description:(NSString *)theDescription inDir:(NSString *)dir windowController:(NSWindowController *)windowController
6969
{
7070
controller = windowController;
7171
arguments = args;
@@ -120,7 +120,7 @@ - (void) taskCompleted:(NSNotification *)notification
120120
[self showSuccessMessage];
121121

122122
if ([controller respondsToSelector:@selector(repository)])
123-
[controller.repository reloadRefs];
123+
[[(PBGitWindowController *)controller repository] reloadRefs];
124124
}
125125

126126

@@ -146,7 +146,8 @@ - (void) showSuccessMessage
146146
[info appendString:[self commandDescription]];
147147
[info appendString:[self standardOutputDescription]];
148148

149-
[(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info];
149+
if ([controller respondsToSelector:@selector(showMessageSheet:infoText:)])
150+
[(PBGitWindowController *)controller showMessageSheet:[self successTitle] infoText:info];
150151
}
151152

152153

@@ -164,7 +165,8 @@ - (void) showErrorMessage
164165
nil];
165166
NSError *error = [NSError errorWithDomain:PBGitRepositoryErrorDomain code:0 userInfo:errorUserInfo];
166167

167-
[(PBGitWindowController *)controller showErrorSheet:error];
168+
if ([controller respondsToSelector:@selector(showErrorSheet:)])
169+
[(PBGitWindowController *)controller showErrorSheet:error];
168170
}
169171

170172

0 commit comments

Comments
 (0)