mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 13:07:02 +00:00
Fixed: check the entire project with capp_lint doesn't open the reporting window or a notification
This commit is contained in:
@@ -45,7 +45,8 @@ enum {
|
||||
extern NSString * const XCCConversionDidStartNotification;
|
||||
extern NSString * const XCCConversionDidEndNotification;
|
||||
extern NSString * const XCCProjectDidFinishLoadingNotification;
|
||||
|
||||
extern NSString * const XCCCappLintDidStartNotification;
|
||||
extern NSString * const XCCCappLintDidEndNotification;
|
||||
|
||||
@interface XcodeCapp : NSObject <NSTableViewDelegate, NSUserNotificationCenterDelegate, GrowlApplicationBridgeDelegate>
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ static NSPredicate * XCCDirectoriesToIgnorePredicate = nil;
|
||||
// An array of the default predicates used to ignore paths.
|
||||
static NSArray *XCCDefaultIgnoredPathPredicates = nil;
|
||||
|
||||
NSString * const XCCCappLintDidStartNotification = @"XCCCappLintDidStartNotification";
|
||||
NSString * const XCCCappLintDidEndNotification = @"XCCCappLintDidEndNotification";
|
||||
|
||||
@interface XcodeCapp ()
|
||||
|
||||
@@ -1719,15 +1721,26 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
- (IBAction)checkProjectWithCappLint:(id)aSender
|
||||
{
|
||||
[self clearErrors:self];
|
||||
|
||||
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
|
||||
[center addObserver:self selector:@selector(cappLintDidEndNotification:) name:XCCCappLintDidEndNotification object:nil];
|
||||
|
||||
[self performSelectorInBackground:@selector(checkCappLintForPath:) withObject:self.projectPath];
|
||||
}
|
||||
|
||||
- (void)cappLintDidEndNotification:(NSNotification*)aNotification
|
||||
{
|
||||
[self showCappLintErrors];
|
||||
[[NSNotificationCenter defaultCenter] removeObserver:self name:XCCCappLintDidEndNotification object:nil];
|
||||
}
|
||||
|
||||
- (BOOL)checkCappLintForPath:(NSString*)aPath
|
||||
{
|
||||
DDLogVerbose(@"Checking path %@ with capp_lint", aPath);
|
||||
|
||||
self.isProcessing = YES;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidStartNotification object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCCappLintDidStartNotification object:self];
|
||||
|
||||
NSString *baseDirectory = [NSString stringWithFormat:@"--basedir='%@'", self.projectPath];
|
||||
NSArray *arguments = [NSArray arrayWithObjects:baseDirectory, aPath, nil];
|
||||
@@ -1781,6 +1794,7 @@ void fsevents_callback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
self.isProcessing = NO;
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCBatchDidEndNotification object:self];
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:XCCCappLintDidEndNotification object:self];
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user