From b8ea97f1be6cacc12cc6aecca5202a6e564a8130 Mon Sep 17 00:00:00 2001 From: Nils Tekampe Date: Fri, 5 Jun 2015 10:16:50 +0200 Subject: [PATCH] beautifiying --- macbrush/macbrush/main.m | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/macbrush/macbrush/main.m b/macbrush/macbrush/main.m index 450b538..a5c7e70 100644 --- a/macbrush/macbrush/main.m +++ b/macbrush/macbrush/main.m @@ -145,7 +145,7 @@ int main(int argc, const char * argv[]) { patternMatchingArray = [NSArray arrayWithObjects:patternAPDisk,patternDSStore,patternVolumeIcon,nil]; - + //******************************************************** //Starting main functionality. 1st step: Clean directories @@ -304,7 +304,7 @@ bool processFile(NSString* file){ return false; } } - } + } } } @@ -317,16 +317,16 @@ bool processFile(NSString* file){ logger([NSString stringWithFormat:@"%@%@", @"Found the following file:" , file],true); if (!simulate && !pattern.ignore){ - if ([manager removeItemAtPath:file error:&error]) - { - logger(@"Sucesfully removed file",true); - pattern.matchCount++; - return true; - } - else { - logger(@"Error removing file",true); - return false; - } + if ([manager removeItemAtPath:file error:&error]) + { + logger(@"Sucesfully removed file",true); + pattern.matchCount++; + return true; + } + else { + logger(@"Error removing file",true); + return false; + } } @@ -363,19 +363,14 @@ void cleanDirectory(NSString *directory) logger([NSString stringWithFormat:@"%@%@", @"Finished cleaning directory :" , directory],false); - + for(PatternMatchingString *pattern in patternMatchingArray) { - + logger([NSString stringWithFormat:@"%d%@%@%@",pattern.matchCount, @" " ,pattern.pattern, @" files have been removed"],false); - + } - - // logger([NSString stringWithFormat:@"%d%@",sumDotAPDisk, @" .AP_Disk files have been removed"],false); - // logger([NSString stringWithFormat:@"%d%@",sumDotUnderscore, @" ._ files have been removed"],false); - //logger([NSString stringWithFormat:@"%d%@",sumDSStore, @" .DS_Store files have been removed"],false); - // logger([NSString stringWithFormat:@"%d%@",sumVolumeIcon, @" .VolumeIcon.icns files have been removed"],false); } bool isFile(NSString *file){