From 559934607b7368b6f83255247c8b06963d30aaaf Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 1 Apr 2017 00:30:25 -0400 Subject: [PATCH] Reformat to AppCode style. --- platform-darwin/Source/MPAlgorithm.h | 2 +- platform-darwin/Source/MPAlgorithmV0.m | 6 +-- platform-darwin/Source/MPAlgorithmV3.m | 2 +- platform-darwin/Source/MPAppDelegate_Key.m | 8 ++-- platform-darwin/Source/MPAppDelegate_Shared.h | 4 +- platform-darwin/Source/MPAppDelegate_Shared.m | 5 +-- platform-darwin/Source/MPAppDelegate_Store.h | 12 +++--- platform-darwin/Source/MPAppDelegate_Store.m | 16 ++++---- platform-darwin/Source/MPConfig.m | 12 +++--- .../Source/MPGeneratedSiteEntity.h | 3 +- .../Source/MPGeneratedSiteEntity.m | 1 - platform-darwin/Source/MPKey.h | 2 +- platform-darwin/Source/MPSiteEntity.h | 22 +++++------ platform-darwin/Source/MPSiteEntity.m | 1 - platform-darwin/Source/MPSiteQuestionEntity.h | 4 +- platform-darwin/Source/MPSiteQuestionEntity.m | 1 - platform-darwin/Source/MPStoredSiteEntity.h | 3 +- platform-darwin/Source/MPStoredSiteEntity.m | 1 - platform-darwin/Source/MPUserEntity.h | 20 +++++----- platform-darwin/Source/MPUserEntity.m | 1 - .../Source/Mac/MPInitialWindowController.m | 4 +- platform-darwin/Source/Mac/MPMacAppDelegate.m | 21 +++++----- platform-darwin/Source/Mac/MPMacApplication.m | 2 +- platform-darwin/Source/Mac/MPMacConfig.m | 4 +- platform-darwin/Source/Mac/MPNoStateButton.h | 1 - platform-darwin/Source/Mac/MPNoStateButton.m | 2 - platform-darwin/Source/Mac/MPPasswordWindow.h | 1 - platform-darwin/Source/Mac/MPPasswordWindow.m | 2 +- .../Source/Mac/MPPasswordWindowController.m | 2 +- platform-darwin/Source/Mac/MPSiteModel.h | 38 +++++++++---------- platform-darwin/Source/Mac/MPSiteModel.m | 4 +- .../Source/iOS/MPAnswersViewController.h | 8 ++-- platform-darwin/Source/iOS/MPAvatarCell.h | 17 +++++---- .../Source/iOS/MPCombinedViewController.h | 2 +- .../Source/iOS/MPCombinedViewController.m | 4 +- .../Source/iOS/MPEmergencyViewController.h | 2 +- .../Source/iOS/MPLogsViewController.h | 5 ++- .../Source/iOS/MPMessageViewController.h | 2 +- .../Source/iOS/MPNavigationController.h | 1 - .../Source/iOS/MPOverlayViewController.h | 1 - .../Source/iOS/MPOverlayViewController.m | 2 +- platform-darwin/Source/iOS/MPPasswordCell.h | 4 +- platform-darwin/Source/iOS/MPPasswordCell.m | 12 +++--- platform-darwin/Source/iOS/MPPasswordsSegue.h | 2 +- .../Source/iOS/MPPasswordsViewController.h | 2 +- .../Source/iOS/MPPasswordsViewController.m | 10 ++--- .../Source/iOS/MPPreferencesViewController.m | 8 ++-- platform-darwin/Source/iOS/MPRootSegue.h | 2 - platform-darwin/Source/iOS/MPRootSegue.m | 2 - .../Source/iOS/MPTypeViewController.m | 14 +++---- .../Source/iOS/MPUsersViewController.h | 2 +- .../Source/iOS/MPWebViewController.h | 3 +- platform-darwin/Source/iOS/MPiOSAppDelegate.h | 2 +- platform-darwin/Source/iOS/MPiOSAppDelegate.m | 14 +++---- platform-darwin/Source/iOS/MPiOSConfig.m | 20 +++++----- .../Source/iOS/NSString+MPMarkDown.m | 28 +++++++------- 56 files changed, 180 insertions(+), 196 deletions(-) diff --git a/platform-darwin/Source/MPAlgorithm.h b/platform-darwin/Source/MPAlgorithm.h index 2c7d86f9..bd231785 100644 --- a/platform-darwin/Source/MPAlgorithm.h +++ b/platform-darwin/Source/MPAlgorithm.h @@ -82,7 +82,7 @@ NSString *NSStringFromTimeToCrack(TimeToCrack timeToCrack); - (void)resolvePasswordForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey result:(void ( ^ )(NSString *result))resultBlock; - (void)resolveAnswerForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey - result:(void ( ^ )(NSString *result))resultBlock; + result:(void ( ^ )(NSString *result))resultBlock; - (void)resolveAnswerForQuestion:(MPSiteQuestionEntity *)question usingKey:(MPKey *)siteKey result:(void ( ^ )(NSString *result))resultBlock; diff --git a/platform-darwin/Source/MPAlgorithmV0.m b/platform-darwin/Source/MPAlgorithmV0.m index fe5d5ea2..a9e4757e 100644 --- a/platform-darwin/Source/MPAlgorithmV0.m +++ b/platform-darwin/Source/MPAlgorithmV0.m @@ -426,7 +426,7 @@ NSOperationQueue *_mpwQueue = nil; [PearlKeyChain deleteItemForQuery:siteQuery]; else [PearlKeyChain addOrUpdateItemForQuery:siteQuery withAttributes:@{ - (__bridge id)kSecValueData : encryptedContent, + (__bridge id)kSecValueData: encryptedContent, #if TARGET_OS_IPHONE (__bridge id)kSecAttrAccessible : (__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly, #endif @@ -730,8 +730,8 @@ NSOperationQueue *_mpwQueue = nil; return [PearlKeyChain createQueryForClass:kSecClassGenericPassword attributes:@{ - (__bridge id)kSecAttrService : @"DevicePrivate", - (__bridge id)kSecAttrAccount : name + (__bridge id)kSecAttrService: @"DevicePrivate", + (__bridge id)kSecAttrAccount: name } matches:nil]; } diff --git a/platform-darwin/Source/MPAlgorithmV3.m b/platform-darwin/Source/MPAlgorithmV3.m index 4d4f8b19..2f34557e 100644 --- a/platform-darwin/Source/MPAlgorithmV3.m +++ b/platform-darwin/Source/MPAlgorithmV3.m @@ -33,7 +33,7 @@ if (!explicit) { if (site.type & MPSiteTypeClassGenerated && - site.user.name.length != [site.user.name dataUsingEncoding:NSUTF8StringEncoding].length) { + site.user.name.length != [site.user.name dataUsingEncoding:NSUTF8StringEncoding].length) { // This migration requires explicit permission for types of the generated class. site.requiresExplicitMigration = YES; return NO; diff --git a/platform-darwin/Source/MPAppDelegate_Key.m b/platform-darwin/Source/MPAppDelegate_Key.m index c582ff42..61738e5d 100644 --- a/platform-darwin/Source/MPAppDelegate_Key.m +++ b/platform-darwin/Source/MPAppDelegate_Key.m @@ -49,8 +49,8 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi return [PearlKeyChain createQueryForClass:kSecClassGenericPassword attributes:@{ - (__bridge id)kSecAttrService : @"Saved Master Password", - (__bridge id)kSecAttrAccount : user.name?: @"", + (__bridge id)kSecAttrService: @"Saved Master Password", + (__bridge id)kSecAttrAccount: user.name?: @"", #if TARGET_OS_IPHONE (__bridge id)kSecAttrAccessible : (__bridge id)(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly?: kSecAttrAccessibleWhenUnlockedThisDeviceOnly), #endif @@ -81,7 +81,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi inf( @"Saving key in keychain for user: %@", user.userID ); [PearlKeyChain addOrUpdateItemForQuery:createKeyQuery( user, YES, nil ) - withAttributes:@{ (__bridge id)kSecValueData : keyData }]; + withAttributes:@{ (__bridge id)kSecValueData: keyData }]; } } } @@ -102,7 +102,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi self.key = nil; self.activeUser = nil; - [[NSNotificationCenter defaultCenter] postNotificationName:MPSignedOutNotification object:self userInfo:@{ @"animated" : @(animated) }]; + [[NSNotificationCenter defaultCenter] postNotificationName:MPSignedOutNotification object:self userInfo:@{ @"animated": @(animated) }]; } - (BOOL)signInAsUser:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc usingMasterPassword:(NSString *)password { diff --git a/platform-darwin/Source/MPAppDelegate_Shared.h b/platform-darwin/Source/MPAppDelegate_Shared.h index 9827758c..59abec1b 100644 --- a/platform-darwin/Source/MPAppDelegate_Shared.h +++ b/platform-darwin/Source/MPAppDelegate_Shared.h @@ -11,7 +11,9 @@ #if TARGET_OS_IPHONE @interface MPAppDelegate_Shared : PearlAppDelegate #else -@interface MPAppDelegate_Shared : NSObject + +@interface MPAppDelegate_Shared : NSObject + #endif @property(strong, nonatomic, readonly) MPKey *key; diff --git a/platform-darwin/Source/MPAppDelegate_Shared.m b/platform-darwin/Source/MPAppDelegate_Shared.m index be65cb0c..bf8580c4 100644 --- a/platform-darwin/Source/MPAppDelegate_Shared.m +++ b/platform-darwin/Source/MPAppDelegate_Shared.m @@ -11,7 +11,7 @@ #import "MPAppDelegate_Key.h" #import "NSManagedObjectModel+KCOrderedAccessorFix.h" -@interface MPAppDelegate_Shared () +@interface MPAppDelegate_Shared() @property(strong, nonatomic) MPKey *key; @property(strong, nonatomic) NSManagedObjectID *activeUserOID; @@ -66,13 +66,12 @@ NSError *error; if (activeUser.objectID.isTemporaryID && ![activeUser.managedObjectContext obtainPermanentIDsForObjects:@[ activeUser ] error:&error]) - err(@"Failed to obtain a permanent object ID after setting active user: %@", [error fullDescription]); + err( @"Failed to obtain a permanent object ID after setting active user: %@", [error fullDescription] ); self.activeUserOID = activeUser.objectID; } - (void)handleCoordinatorError:(NSError *)error { - } @end diff --git a/platform-darwin/Source/MPAppDelegate_Store.h b/platform-darwin/Source/MPAppDelegate_Store.h index 9f5a7b04..5df7586b 100644 --- a/platform-darwin/Source/MPAppDelegate_Store.h +++ b/platform-darwin/Source/MPAppDelegate_Store.h @@ -21,10 +21,10 @@ typedef NS_ENUM( NSUInteger, MPImportResult ) { @interface MPAppDelegate_Shared(Store) + (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady; -+ (BOOL)managedObjectContextForMainThreadPerformBlock:(void (^)(NSManagedObjectContext *mainContext))mocBlock; -+ (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void (^)(NSManagedObjectContext *mainContext))mocBlock; -+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock; -+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock; ++ (BOOL)managedObjectContextForMainThreadPerformBlock:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock; ++ (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock; ++ (BOOL)managedObjectContextPerformBlock:(void ( ^ )(NSManagedObjectContext *context))mocBlock; ++ (BOOL)managedObjectContextPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *context))mocBlock; - (MPFixableResult)findAndFixInconsistenciesSaveInContext:(NSManagedObjectContext *)context; - (void)deleteAndResetStore; @@ -33,8 +33,8 @@ typedef NS_ENUM( NSUInteger, MPImportResult ) { - (void)addSiteNamed:(NSString *)siteName completion:(void ( ^ )(MPSiteEntity *site, NSManagedObjectContext *context))completion; - (MPSiteEntity *)changeSite:(MPSiteEntity *)site saveInContext:(NSManagedObjectContext *)context toType:(MPSiteType)type; - (MPImportResult)importSites:(NSString *)importedSitesString - askImportPassword:(NSString *(^)(NSString *userName))importPassword - askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword; + askImportPassword:(NSString *( ^ )(NSString *userName))importPassword + askUserPassword:(NSString *( ^ )(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword; - (NSString *)exportSitesRevealPasswords:(BOOL)revealPasswords; @end diff --git a/platform-darwin/Source/MPAppDelegate_Store.m b/platform-darwin/Source/MPAppDelegate_Store.m index 14703730..41a2ce63 100644 --- a/platform-darwin/Source/MPAppDelegate_Store.m +++ b/platform-darwin/Source/MPAppDelegate_Store.m @@ -211,8 +211,8 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); } if (![self.storeCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self localStoreURL] options:@{ - NSMigratePersistentStoresAutomaticallyOption : @YES, - NSInferMappingModelAutomaticallyOption : @YES, + NSMigratePersistentStoresAutomaticallyOption: @YES, + NSInferMappingModelAutomaticallyOption : @YES, STORE_OPTIONS } error:&error]) { err( @"Failed to open store: %@", [error fullDescription] ); @@ -292,7 +292,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); else { [context saveToStore]; [[NSNotificationCenter defaultCenter] postNotificationName:MPFoundInconsistenciesNotification object:nil userInfo:@{ - MPInconsistenciesFixResultUserKey : @(result) + MPInconsistenciesFixResultUserKey: @(result) }]; } @@ -383,12 +383,12 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); NSError *error = nil; if (![NSPersistentStore migrateStore:oldLocalStoreURL withOptions:@{ - NSMigratePersistentStoresAutomaticallyOption : @YES, - NSInferMappingModelAutomaticallyOption : @YES, + NSMigratePersistentStoresAutomaticallyOption: @YES, + NSInferMappingModelAutomaticallyOption : @YES, STORE_OPTIONS } toStore:newLocalStoreURL withOptions:@{ - NSMigratePersistentStoresAutomaticallyOption : @YES, - NSInferMappingModelAutomaticallyOption : @YES, + NSMigratePersistentStoresAutomaticallyOption: @YES, + NSInferMappingModelAutomaticallyOption : @YES, STORE_OPTIONS } model:nil error:&error]) { err( @"Couldn't migrate the old store to the new location: %@", [error fullDescription] ); @@ -755,7 +755,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted ); inf( @"Import completed successfully." ); [[NSNotificationCenter defaultCenter] postNotificationName:MPSitesImportedNotification object:nil userInfo:@{ - MPSitesImportedNotificationUserKey : user + MPSitesImportedNotificationUserKey: user }]; return MPImportResultSuccess; diff --git a/platform-darwin/Source/MPConfig.m b/platform-darwin/Source/MPConfig.m index 3d3be2f2..1503dcc4 100644 --- a/platform-darwin/Source/MPConfig.m +++ b/platform-darwin/Source/MPConfig.m @@ -18,13 +18,13 @@ return nil; [self.defaults registerDefaults:@{ - NSStringFromSelector( @selector( askForReviews ) ) : @YES, + NSStringFromSelector( @selector( askForReviews ) ) : @YES, - NSStringFromSelector( @selector( sendInfo ) ) : @NO, - NSStringFromSelector( @selector( rememberLogin ) ) : @NO, - NSStringFromSelector( @selector( hidePasswords ) ) : @NO, - NSStringFromSelector( @selector( checkInconsistency ) ) : @NO, - NSStringFromSelector( @selector( siteAttacker ) ) : @(MPAttacker1), + NSStringFromSelector( @selector( sendInfo ) ) : @NO, + NSStringFromSelector( @selector( rememberLogin ) ) : @NO, + NSStringFromSelector( @selector( hidePasswords ) ) : @NO, + NSStringFromSelector( @selector( checkInconsistency ) ): @NO, + NSStringFromSelector( @selector( siteAttacker ) ) : @(MPAttacker1), }]; self.delegate = [MPAppDelegate_Shared get]; diff --git a/platform-darwin/Source/MPGeneratedSiteEntity.h b/platform-darwin/Source/MPGeneratedSiteEntity.h index af7760be..c50cbcfd 100644 --- a/platform-darwin/Source/MPGeneratedSiteEntity.h +++ b/platform-darwin/Source/MPGeneratedSiteEntity.h @@ -10,9 +10,8 @@ #import #import "MPSiteEntity.h" - @interface MPGeneratedSiteEntity : MPSiteEntity -@property (nonatomic, retain) NSNumber * counter_; +@property(nonatomic, retain) NSNumber *counter_; @end diff --git a/platform-darwin/Source/MPGeneratedSiteEntity.m b/platform-darwin/Source/MPGeneratedSiteEntity.m index 0d96650a..5a6dca94 100644 --- a/platform-darwin/Source/MPGeneratedSiteEntity.m +++ b/platform-darwin/Source/MPGeneratedSiteEntity.m @@ -8,7 +8,6 @@ #import "MPGeneratedSiteEntity.h" - @implementation MPGeneratedSiteEntity @dynamic counter_; diff --git a/platform-darwin/Source/MPKey.h b/platform-darwin/Source/MPKey.h index f145102d..bcdb08e3 100644 --- a/platform-darwin/Source/MPKey.h +++ b/platform-darwin/Source/MPKey.h @@ -20,7 +20,7 @@ @protocol MPAlgorithm; -typedef NS_ENUM(NSUInteger, MPKeyOrigin) { +typedef NS_ENUM( NSUInteger, MPKeyOrigin ) { MPKeyOriginMasterPassword, MPKeyOriginKeyChain, MPKeyOriginKeyChainBiometric, diff --git a/platform-darwin/Source/MPSiteEntity.h b/platform-darwin/Source/MPSiteEntity.h index f938e93b..1591f732 100644 --- a/platform-darwin/Source/MPSiteEntity.h +++ b/platform-darwin/Source/MPSiteEntity.h @@ -14,19 +14,19 @@ @interface MPSiteEntity : NSManagedObject //@property (nonatomic, retain) id content; // Hide here, reveal in MPStoredSiteEntity -@property (nonatomic, retain) NSDate * lastUsed; -@property (nonatomic, retain) NSNumber * loginGenerated_; -@property (nonatomic, retain) NSString * loginName; -@property (nonatomic, retain) NSString * name; -@property (nonatomic, retain) NSNumber * requiresExplicitMigration_; -@property (nonatomic, retain) NSNumber * type_; -@property (nonatomic, retain) NSNumber * uses_; -@property (nonatomic, retain) NSNumber * version_; -@property (nonatomic, retain) NSOrderedSet *questions; -@property (nonatomic, retain) MPUserEntity *user; +@property(nonatomic, retain) NSDate *lastUsed; +@property(nonatomic, retain) NSNumber *loginGenerated_; +@property(nonatomic, retain) NSString *loginName; +@property(nonatomic, retain) NSString *name; +@property(nonatomic, retain) NSNumber *requiresExplicitMigration_; +@property(nonatomic, retain) NSNumber *type_; +@property(nonatomic, retain) NSNumber *uses_; +@property(nonatomic, retain) NSNumber *version_; +@property(nonatomic, retain) NSOrderedSet *questions; +@property(nonatomic, retain) MPUserEntity *user; @end -@interface MPSiteEntity (CoreDataGeneratedAccessors) +@interface MPSiteEntity(CoreDataGeneratedAccessors) - (void)insertObject:(MPSiteQuestionEntity *)value inQuestionsAtIndex:(NSUInteger)idx; - (void)removeObjectFromQuestionsAtIndex:(NSUInteger)idx; diff --git a/platform-darwin/Source/MPSiteEntity.m b/platform-darwin/Source/MPSiteEntity.m index 3c7b8dba..7ad2b02c 100644 --- a/platform-darwin/Source/MPSiteEntity.m +++ b/platform-darwin/Source/MPSiteEntity.m @@ -10,7 +10,6 @@ #import "MPSiteQuestionEntity.h" #import "MPUserEntity.h" - @implementation MPSiteEntity //@dynamic content; diff --git a/platform-darwin/Source/MPSiteQuestionEntity.h b/platform-darwin/Source/MPSiteQuestionEntity.h index 313daf11..a7c1c8ee 100644 --- a/platform-darwin/Source/MPSiteQuestionEntity.h +++ b/platform-darwin/Source/MPSiteQuestionEntity.h @@ -13,7 +13,7 @@ @interface MPSiteQuestionEntity : NSManagedObject -@property (nonatomic, retain) NSString * keyword; -@property (nonatomic, retain) MPSiteEntity *site; +@property(nonatomic, retain) NSString *keyword; +@property(nonatomic, retain) MPSiteEntity *site; @end diff --git a/platform-darwin/Source/MPSiteQuestionEntity.m b/platform-darwin/Source/MPSiteQuestionEntity.m index 12004ada..c59f9ad9 100644 --- a/platform-darwin/Source/MPSiteQuestionEntity.m +++ b/platform-darwin/Source/MPSiteQuestionEntity.m @@ -9,7 +9,6 @@ #import "MPSiteQuestionEntity.h" #import "MPSiteEntity.h" - @implementation MPSiteQuestionEntity @dynamic keyword; diff --git a/platform-darwin/Source/MPStoredSiteEntity.h b/platform-darwin/Source/MPStoredSiteEntity.h index 32d166a6..ec078a76 100644 --- a/platform-darwin/Source/MPStoredSiteEntity.h +++ b/platform-darwin/Source/MPStoredSiteEntity.h @@ -10,9 +10,8 @@ #import #import "MPSiteEntity.h" - @interface MPStoredSiteEntity : MPSiteEntity -@property (nonatomic, retain) NSData *contentObject; +@property(nonatomic, retain) NSData *contentObject; @end diff --git a/platform-darwin/Source/MPStoredSiteEntity.m b/platform-darwin/Source/MPStoredSiteEntity.m index 4ff1497e..f4323600 100644 --- a/platform-darwin/Source/MPStoredSiteEntity.m +++ b/platform-darwin/Source/MPStoredSiteEntity.m @@ -8,7 +8,6 @@ #import "MPStoredSiteEntity.h" - @implementation MPStoredSiteEntity @dynamic contentObject; diff --git a/platform-darwin/Source/MPUserEntity.h b/platform-darwin/Source/MPUserEntity.h index 0d7c687d..a05cdb03 100644 --- a/platform-darwin/Source/MPUserEntity.h +++ b/platform-darwin/Source/MPUserEntity.h @@ -13,18 +13,18 @@ @interface MPUserEntity : NSManagedObject -@property (nonatomic, retain) NSNumber * avatar_; -@property (nonatomic, retain) NSNumber * defaultType_; -@property (nonatomic, retain) NSData * keyID; -@property (nonatomic, retain) NSDate * lastUsed; -@property (nonatomic, retain) NSString * name; -@property (nonatomic, retain) NSNumber * saveKey_; -@property (nonatomic, retain) NSNumber * touchID_; -@property (nonatomic, retain) NSNumber * version_; -@property (nonatomic, retain) NSSet *sites; +@property(nonatomic, retain) NSNumber *avatar_; +@property(nonatomic, retain) NSNumber *defaultType_; +@property(nonatomic, retain) NSData *keyID; +@property(nonatomic, retain) NSDate *lastUsed; +@property(nonatomic, retain) NSString *name; +@property(nonatomic, retain) NSNumber *saveKey_; +@property(nonatomic, retain) NSNumber *touchID_; +@property(nonatomic, retain) NSNumber *version_; +@property(nonatomic, retain) NSSet *sites; @end -@interface MPUserEntity (CoreDataGeneratedAccessors) +@interface MPUserEntity(CoreDataGeneratedAccessors) - (void)addSitesObject:(MPSiteEntity *)value; - (void)removeSitesObject:(MPSiteEntity *)value; diff --git a/platform-darwin/Source/MPUserEntity.m b/platform-darwin/Source/MPUserEntity.m index d969ebba..8c752277 100644 --- a/platform-darwin/Source/MPUserEntity.m +++ b/platform-darwin/Source/MPUserEntity.m @@ -9,7 +9,6 @@ #import "MPUserEntity.h" #import "MPSiteEntity.h" - @implementation MPUserEntity @dynamic avatar_; diff --git a/platform-darwin/Source/Mac/MPInitialWindowController.m b/platform-darwin/Source/Mac/MPInitialWindowController.m index d79f01c2..7543a94b 100644 --- a/platform-darwin/Source/Mac/MPInitialWindowController.m +++ b/platform-darwin/Source/Mac/MPInitialWindowController.m @@ -30,8 +30,8 @@ [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:self.window queue:nil usingBlock:^(NSNotification *note) { - [MPMacAppDelegate get].initialWindowController = nil; - }]; + [MPMacAppDelegate get].initialWindowController = nil; + }]; } #pragma mark - Actions diff --git a/platform-darwin/Source/Mac/MPMacAppDelegate.m b/platform-darwin/Source/Mac/MPMacAppDelegate.m index 23873b15..6fb4379f 100644 --- a/platform-darwin/Source/Mac/MPMacAppDelegate.m +++ b/platform-darwin/Source/Mac/MPMacAppDelegate.m @@ -123,12 +123,10 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven ^(MPMacAppDelegate *self, NSNotification *note) { PearlMainQueue( ^{ NSString *key = note.object; - if (!key || [key isEqualToString:NSStringFromSelector( @ - selector( hidePasswords ) )]) - self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState; - if (!key || [key isEqualToString:NSStringFromSelector( @ - selector( rememberLogin ) )]) - self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState; + if (!key || [key isEqualToString:NSStringFromSelector( @selector( hidePasswords ) )]) + self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState; + if (!key || [key isEqualToString:NSStringFromSelector( @selector( rememberLogin ) )]) + self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState; } ); } ); [self updateUsers]; @@ -136,7 +134,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven // Global hotkey. EventHotKeyRef hotKeyRef; EventTypeSpec hotKeyEvents[1] = { { .eventClass = kEventClassKeyboard, .eventKind = kEventHotKeyPressed } }; - OSStatus status = InstallApplicationEventHandler( NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ), hotKeyEvents, (__bridge void *)self, NULL ); + OSStatus status = InstallApplicationEventHandler( NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ), hotKeyEvents, + (__bridge void *)self, NULL ); if (status != noErr) err( @"Error installing application event handler: %i", (int)status ); status = RegisterEventHotKey( 35 /* p */, controlKey + cmdKey, MPShowHotKey, GetApplicationEventTarget(), 0, &hotKeyRef ); @@ -318,17 +317,17 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven break; case MPImportResultInternalError: [[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey : @"Import failed because of an internal error." + NSLocalizedDescriptionKey: @"Import failed because of an internal error." }]] runModal]; break; case MPImportResultMalformedInput: [[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey : @"The import doesn't look like a Master Password export." + NSLocalizedDescriptionKey: @"The import doesn't look like a Master Password export." }]] runModal]; break; case MPImportResultInvalidPassword: [[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey : @"Incorrect master password for the import sites." + NSLocalizedDescriptionKey: @"Incorrect master password for the import sites." }]] runModal]; break; } @@ -441,7 +440,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven prof_new( @"showPasswordWindow" ); [NSApp activateIgnoringOtherApps:YES]; - prof_rewind(@"activateIgnoringOtherApps"); + prof_rewind( @"activateIgnoringOtherApps" ); // If no user, can't activate. if (![self activeUserForMainThread]) { diff --git a/platform-darwin/Source/Mac/MPMacApplication.m b/platform-darwin/Source/Mac/MPMacApplication.m index 9d345f22..e37054ae 100644 --- a/platform-darwin/Source/Mac/MPMacApplication.m +++ b/platform-darwin/Source/Mac/MPMacApplication.m @@ -5,7 +5,7 @@ #import "MPMacApplication.h" -@interface NSResponder (Editing) +@interface NSResponder(Editing) - (void)undo:(id)sender; - (void)redo:(id)sender; diff --git a/platform-darwin/Source/Mac/MPMacConfig.m b/platform-darwin/Source/Mac/MPMacConfig.m index 0f494bc9..e0145679 100644 --- a/platform-darwin/Source/Mac/MPMacConfig.m +++ b/platform-darwin/Source/Mac/MPMacConfig.m @@ -17,8 +17,8 @@ return self; [self.defaults registerDefaults:@{ - NSStringFromSelector( @selector( appleID ) ) : @"510296984", - NSStringFromSelector( @selector( fullScreen ) ) : @YES, + NSStringFromSelector( @selector( appleID ) ) : @"510296984", + NSStringFromSelector( @selector( fullScreen ) ): @YES, }]; return self; diff --git a/platform-darwin/Source/Mac/MPNoStateButton.h b/platform-darwin/Source/Mac/MPNoStateButton.h index d347e5d2..41250337 100644 --- a/platform-darwin/Source/Mac/MPNoStateButton.h +++ b/platform-darwin/Source/Mac/MPNoStateButton.h @@ -18,6 +18,5 @@ #import - @interface MPNoStateButtonCell : NSButtonCell @end diff --git a/platform-darwin/Source/Mac/MPNoStateButton.m b/platform-darwin/Source/Mac/MPNoStateButton.m index 7c06e6a2..54a25566 100644 --- a/platform-darwin/Source/Mac/MPNoStateButton.m +++ b/platform-darwin/Source/Mac/MPNoStateButton.m @@ -18,9 +18,7 @@ #import "MPNoStateButton.h" - @implementation MPNoStateButtonCell { - } - (void)setState:(NSInteger)state { diff --git a/platform-darwin/Source/Mac/MPPasswordWindow.h b/platform-darwin/Source/Mac/MPPasswordWindow.h index 9d5dc1d7..7219fc04 100644 --- a/platform-darwin/Source/Mac/MPPasswordWindow.h +++ b/platform-darwin/Source/Mac/MPPasswordWindow.h @@ -18,7 +18,6 @@ #import - @interface MPPasswordWindow : NSWindow @end diff --git a/platform-darwin/Source/Mac/MPPasswordWindow.m b/platform-darwin/Source/Mac/MPPasswordWindow.m index a09ae59f..be822bea 100644 --- a/platform-darwin/Source/Mac/MPPasswordWindow.m +++ b/platform-darwin/Source/Mac/MPPasswordWindow.m @@ -37,7 +37,7 @@ } else if (self.level != NSNormalWindowLevel) { [self setLevel:NSNormalWindowLevel]; - [self setFrame:NSMakeRect( 0, 0, 640, 600) display:NO]; + [self setFrame:NSMakeRect( 0, 0, 640, 600 ) display:NO]; [self center]; } diff --git a/platform-darwin/Source/Mac/MPPasswordWindowController.m b/platform-darwin/Source/Mac/MPPasswordWindowController.m index 44635a0b..349cade5 100644 --- a/platform-darwin/Source/Mac/MPPasswordWindowController.m +++ b/platform-darwin/Source/Mac/MPPasswordWindowController.m @@ -173,7 +173,7 @@ [self.progressView stopAnimation:self]; if (!success) [[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ - NSLocalizedDescriptionKey : strf( @"Incorrect master password for user %@", userName ) + NSLocalizedDescriptionKey: strf( @"Incorrect master password for user %@", userName ) }]] beginSheetModalForWindow:self.window completionHandler:nil]; } ); }]; diff --git a/platform-darwin/Source/Mac/MPSiteModel.h b/platform-darwin/Source/Mac/MPSiteModel.h index 7b4906a7..f1101fea 100644 --- a/platform-darwin/Source/Mac/MPSiteModel.h +++ b/platform-darwin/Source/Mac/MPSiteModel.h @@ -25,25 +25,25 @@ @interface MPSiteModel : NSObject -@property (nonatomic) NSString *name; -@property (nonatomic) NSAttributedString *displayedName; -@property (nonatomic) MPSiteType type; -@property (nonatomic) NSString *typeName; -@property (nonatomic) NSString *content; -@property (nonatomic) NSString *displayedContent; -@property (nonatomic) NSString *question; -@property (nonatomic) NSString *answer; -@property (nonatomic) NSString *loginName; -@property (nonatomic) BOOL loginGenerated; -@property (nonatomic) NSNumber *uses; -@property (nonatomic) NSUInteger counter; -@property (nonatomic) NSDate *lastUsed; -@property (nonatomic) id algorithm; -@property (nonatomic) MPAlgorithmVersion algorithmVersion; -@property (nonatomic, readonly) BOOL outdated; -@property (nonatomic, readonly) BOOL generated; -@property (nonatomic, readonly) BOOL stored; -@property (nonatomic, readonly) BOOL transient; +@property(nonatomic) NSString *name; +@property(nonatomic) NSAttributedString *displayedName; +@property(nonatomic) MPSiteType type; +@property(nonatomic) NSString *typeName; +@property(nonatomic) NSString *content; +@property(nonatomic) NSString *displayedContent; +@property(nonatomic) NSString *question; +@property(nonatomic) NSString *answer; +@property(nonatomic) NSString *loginName; +@property(nonatomic) BOOL loginGenerated; +@property(nonatomic) NSNumber *uses; +@property(nonatomic) NSUInteger counter; +@property(nonatomic) NSDate *lastUsed; +@property(nonatomic) id algorithm; +@property(nonatomic) MPAlgorithmVersion algorithmVersion; +@property(nonatomic, readonly) BOOL outdated; +@property(nonatomic, readonly) BOOL generated; +@property(nonatomic, readonly) BOOL stored; +@property(nonatomic, readonly) BOOL transient; - (instancetype)initWithEntity:(MPSiteEntity *)entity fuzzyGroups:(NSArray *)fuzzyGroups; - (instancetype)initWithName:(NSString *)siteName forUser:(MPUserEntity *)user; diff --git a/platform-darwin/Source/Mac/MPSiteModel.m b/platform-darwin/Source/Mac/MPSiteModel.m index b6eab976..5366ffae 100644 --- a/platform-darwin/Source/Mac/MPSiteModel.m +++ b/platform-darwin/Source/Mac/MPSiteModel.m @@ -93,8 +93,8 @@ NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; paragraphStyle.alignment = NSCenterTextAlignment; self.displayedName = stra( siteName, @{ - NSBackgroundColorAttributeName : [NSColor alternateSelectedControlColor], - NSParagraphStyleAttributeName : paragraphStyle, + NSBackgroundColorAttributeName: [NSColor alternateSelectedControlColor], + NSParagraphStyleAttributeName : paragraphStyle, } ); self.name = siteName; self.algorithm = MPAlgorithmDefault; diff --git a/platform-darwin/Source/iOS/MPAnswersViewController.h b/platform-darwin/Source/iOS/MPAnswersViewController.h index 19254684..929fbf81 100644 --- a/platform-darwin/Source/iOS/MPAnswersViewController.h +++ b/platform-darwin/Source/iOS/MPAnswersViewController.h @@ -12,7 +12,7 @@ @interface MPAnswersViewController : UIViewController -@property (nonatomic) IBOutlet UITableView *tableView; +@property(nonatomic) IBOutlet UITableView *tableView; - (void)setSite:(MPSiteEntity *)site; - (MPSiteEntity *)siteInContext:(NSManagedObjectContext *)context; @@ -21,8 +21,8 @@ @interface MPGlobalAnswersCell : UITableViewCell -@property (nonatomic) IBOutlet UILabel *titleLabel; -@property (nonatomic) IBOutlet UITextField *answerField; +@property(nonatomic) IBOutlet UILabel *titleLabel; +@property(nonatomic) IBOutlet UITextField *answerField; - (void)setSite:(MPSiteEntity *)site; @@ -32,7 +32,7 @@ @end -@interface MPMultipleAnswersCell : UITableViewCell +@interface MPMultipleAnswersCell : UITableViewCell @end diff --git a/platform-darwin/Source/iOS/MPAvatarCell.h b/platform-darwin/Source/iOS/MPAvatarCell.h index e51fbf3c..69c3a1b3 100644 --- a/platform-darwin/Source/iOS/MPAvatarCell.h +++ b/platform-darwin/Source/iOS/MPAvatarCell.h @@ -23,7 +23,7 @@ /* Avatar with a "+" symbol. */ extern const long MPAvatarAdd; -typedef NS_ENUM(NSUInteger, MPAvatarMode) { +typedef NS_ENUM( NSUInteger, MPAvatarMode ) { MPAvatarModeLowered, MPAvatarModeRaisedButInactive, MPAvatarModeRaisedAndActive, @@ -31,13 +31,14 @@ typedef NS_ENUM(NSUInteger, MPAvatarMode) { MPAvatarModeRaisedAndMinimized, }; -@interface MPAvatarCell : UICollectionViewCell -@property (copy, nonatomic) NSString *name; -@property (assign, nonatomic) NSUInteger avatar; -@property (assign, nonatomic) MPAvatarMode mode; -@property (assign, nonatomic) CGFloat visibility; -@property (assign, nonatomic) BOOL spinnerActive; -@property (assign, nonatomic, readonly) BOOL newUser; +@interface MPAvatarCell : UICollectionViewCell + +@property(copy, nonatomic) NSString *name; +@property(assign, nonatomic) NSUInteger avatar; +@property(assign, nonatomic) MPAvatarMode mode; +@property(assign, nonatomic) CGFloat visibility; +@property(assign, nonatomic) BOOL spinnerActive; +@property(assign, nonatomic, readonly) BOOL newUser; + (NSString *)reuseIdentifier; diff --git a/platform-darwin/Source/iOS/MPCombinedViewController.h b/platform-darwin/Source/iOS/MPCombinedViewController.h index 42cc1f3e..cfb87c5a 100644 --- a/platform-darwin/Source/iOS/MPCombinedViewController.h +++ b/platform-darwin/Source/iOS/MPCombinedViewController.h @@ -20,7 +20,7 @@ #import "MPPasswordsViewController.h" #import "MPEmergencyViewController.h" -typedef NS_ENUM(NSUInteger, MPCombinedMode) { +typedef NS_ENUM( NSUInteger, MPCombinedMode ) { MPCombinedModeUserSelection, MPCombinedModePasswordSelection, }; diff --git a/platform-darwin/Source/iOS/MPCombinedViewController.m b/platform-darwin/Source/iOS/MPCombinedViewController.m index 353c039d..a54b4b33 100644 --- a/platform-darwin/Source/iOS/MPCombinedViewController.m +++ b/platform-darwin/Source/iOS/MPCombinedViewController.m @@ -131,7 +131,7 @@ [self.usersVC setActive:YES animated:animated]; if (_passwordsVC) { MPPasswordsSegue *segue = [[MPPasswordsSegue alloc] initWithIdentifier:@"passwords" source:_passwordsVC destination:self]; - [self prepareForSegue:segue sender:@{ @"animated" : @(animated) }]; + [self prepareForSegue:segue sender:@{ @"animated": @(animated) }]; [segue perform]; } break; @@ -139,7 +139,7 @@ case MPCombinedModePasswordSelection: { self.usersVC.view.userInteractionEnabled = NO; [self.usersVC setActive:NO animated:animated]; - [self performSegueWithIdentifier:@"passwords" sender:@{ @"animated" : @(animated) }]; + [self performSegueWithIdentifier:@"passwords" sender:@{ @"animated": @(animated) }]; break; } } diff --git a/platform-darwin/Source/iOS/MPEmergencyViewController.h b/platform-darwin/Source/iOS/MPEmergencyViewController.h index a974cc27..1699e6df 100644 --- a/platform-darwin/Source/iOS/MPEmergencyViewController.h +++ b/platform-darwin/Source/iOS/MPEmergencyViewController.h @@ -17,7 +17,7 @@ // -@interface MPEmergencyViewController : UIViewController +@interface MPEmergencyViewController : UIViewController @property(weak, nonatomic) IBOutlet UIScrollView *scrollView; @property(weak, nonatomic) IBOutlet UIView *dialogView; diff --git a/platform-darwin/Source/iOS/MPLogsViewController.h b/platform-darwin/Source/iOS/MPLogsViewController.h index 946de9ed..31a7209d 100644 --- a/platform-darwin/Source/iOS/MPLogsViewController.h +++ b/platform-darwin/Source/iOS/MPLogsViewController.h @@ -20,8 +20,9 @@ #import @interface MPLogsViewController : UIViewController -@property (weak, nonatomic) IBOutlet UITextView *logView; -@property (weak, nonatomic) IBOutlet UISegmentedControl *levelControl; + +@property(weak, nonatomic) IBOutlet UITextView *logView; +@property(weak, nonatomic) IBOutlet UISegmentedControl *levelControl; - (IBAction)toggleLevelControl:(UISegmentedControl *)sender; - (IBAction)refresh:(UIBarButtonItem *)sender; diff --git a/platform-darwin/Source/iOS/MPMessageViewController.h b/platform-darwin/Source/iOS/MPMessageViewController.h index 5fd1578c..d9ddd113 100644 --- a/platform-darwin/Source/iOS/MPMessageViewController.h +++ b/platform-darwin/Source/iOS/MPMessageViewController.h @@ -20,6 +20,6 @@ @interface MPMessageViewController : UIViewController -@property (nonatomic) MPMessage *message; +@property(nonatomic) MPMessage *message; @end diff --git a/platform-darwin/Source/iOS/MPNavigationController.h b/platform-darwin/Source/iOS/MPNavigationController.h index ba3cf92d..8b660fca 100644 --- a/platform-darwin/Source/iOS/MPNavigationController.h +++ b/platform-darwin/Source/iOS/MPNavigationController.h @@ -18,6 +18,5 @@ #import - @interface MPNavigationController : UINavigationController @end diff --git a/platform-darwin/Source/iOS/MPOverlayViewController.h b/platform-darwin/Source/iOS/MPOverlayViewController.h index 8f8d7b36..cd7c0003 100644 --- a/platform-darwin/Source/iOS/MPOverlayViewController.h +++ b/platform-darwin/Source/iOS/MPOverlayViewController.h @@ -18,7 +18,6 @@ #import - @interface MPOverlayViewController : UIViewController @end diff --git a/platform-darwin/Source/iOS/MPOverlayViewController.m b/platform-darwin/Source/iOS/MPOverlayViewController.m index a67b7fcd..6a8eb265 100644 --- a/platform-darwin/Source/iOS/MPOverlayViewController.m +++ b/platform-darwin/Source/iOS/MPOverlayViewController.m @@ -80,7 +80,7 @@ for (NSValue *dismissButtonValue in [_dismissSegueByButton allKeys]) if (((UIStoryboardSegue *)_dismissSegueByButton[dismissButtonValue]).sourceViewController == viewController) { dismissButton = [dismissButtonValue nonretainedObjectValue]; - NSAssert([self.view.subviews containsObject:dismissButton], @"Missing dismiss button in dictionary."); + NSAssert( [self.view.subviews containsObject:dismissButton], @"Missing dismiss button in dictionary." ); } if (!dismissButton) return; diff --git a/platform-darwin/Source/iOS/MPPasswordCell.h b/platform-darwin/Source/iOS/MPPasswordCell.h index a9b21dc0..19759908 100644 --- a/platform-darwin/Source/iOS/MPPasswordCell.h +++ b/platform-darwin/Source/iOS/MPPasswordCell.h @@ -25,9 +25,9 @@ typedef NS_ENUM ( NSUInteger, MPPasswordCellMode ) { MPPasswordCellModeSettings, }; -@interface MPPasswordCell : MPCell +@interface MPPasswordCell : MPCell -@property (nonatomic) NSArray *fuzzyGroups; +@property(nonatomic) NSArray *fuzzyGroups; - (void)setSite:(MPSiteEntity *)site animated:(BOOL)animated; - (void)setTransientSite:(NSString *)siteName animated:(BOOL)animated; diff --git a/platform-darwin/Source/iOS/MPPasswordCell.m b/platform-darwin/Source/iOS/MPPasswordCell.m index 8dec4dc3..52dac4de 100644 --- a/platform-darwin/Source/iOS/MPPasswordCell.m +++ b/platform-darwin/Source/iOS/MPPasswordCell.m @@ -532,7 +532,7 @@ self.passwordField.attributedPlaceholder = stra( mainSite.type & MPSiteTypeClassStored? strl( @"No password" ): mainSite.type & MPSiteTypeClassGenerated? strl( @"..." ): @"", @{ - NSForegroundColorAttributeName : [UIColor whiteColor] + NSForegroundColorAttributeName: [UIColor whiteColor] } ); [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { MPSiteEntity *site = [self siteInContext:context]; @@ -570,8 +570,8 @@ [self.modeScrollView addSubview:self.indicatorView]; [self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX metrics:nil views:@{ - @"indicator" : self.indicatorView, - @"target" : settingsMode? self.editButton: self.modeButton + @"indicator": self.indicatorView, + @"target" : settingsMode? self.editButton: self.modeButton }]; } else if (requiresExplicitMigration) { @@ -580,8 +580,8 @@ [self.modeScrollView addSubview:self.indicatorView]; [self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX metrics:nil views:@{ - @"indicator" : self.indicatorView, - @"target" : settingsMode? self.upgradeButton: self.modeButton + @"indicator": self.indicatorView, + @"target" : settingsMode? self.upgradeButton: self.modeButton }]; } else @@ -617,7 +617,7 @@ } [attributedSiteName appendAttributedString:stra( - strf( @" - %@", self.transientSite? @"Tap to create": [site.algorithm shortNameOfType:site.type] ), @{ } )]; + strf( @" - %@", self.transientSite? @"Tap to create": [site.algorithm shortNameOfType:site.type] ), @{} )]; self.siteNameLabel.attributedText = attributedSiteName; } diff --git a/platform-darwin/Source/iOS/MPPasswordsSegue.h b/platform-darwin/Source/iOS/MPPasswordsSegue.h index 29dabbbe..14bb0507 100644 --- a/platform-darwin/Source/iOS/MPPasswordsSegue.h +++ b/platform-darwin/Source/iOS/MPPasswordsSegue.h @@ -20,6 +20,6 @@ @interface MPPasswordsSegue : UIStoryboardSegue -@property (nonatomic, assign) BOOL animated; +@property(nonatomic, assign) BOOL animated; @end diff --git a/platform-darwin/Source/iOS/MPPasswordsViewController.h b/platform-darwin/Source/iOS/MPPasswordsViewController.h index 527a2d74..16189e8f 100644 --- a/platform-darwin/Source/iOS/MPPasswordsViewController.h +++ b/platform-darwin/Source/iOS/MPPasswordsViewController.h @@ -33,7 +33,7 @@ @property(assign, nonatomic) BOOL active; -- (void)setActive:(BOOL)active animated:(BOOL)animated completion:(void (^)(BOOL finished))completion; +- (void)setActive:(BOOL)active animated:(BOOL)animated completion:(void ( ^ )(BOOL finished))completion; - (void)updatePasswords; - (IBAction)dismissPopdown:(id)sender; diff --git a/platform-darwin/Source/iOS/MPPasswordsViewController.m b/platform-darwin/Source/iOS/MPPasswordsViewController.m index 1dfe185d..0769858d 100644 --- a/platform-darwin/Source/iOS/MPPasswordsViewController.m +++ b/platform-darwin/Source/iOS/MPPasswordsViewController.m @@ -91,7 +91,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; if (![MPAlgorithmDefault tryMigrateUser:activeUser inContext:context]) - PearlMainQueue(^{ + PearlMainQueue( ^{ [self performSegueWithIdentifier:@"message" sender: [MPMessage messageWithTitle:@"You have sites that can be upgraded." text: @"Upgrading a site allows it to take advantage of the latest improvements in the Master Password algorithm.\n\n" @@ -99,7 +99,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { "You can then update your site's account with the new and stronger password.\n\n" "The upgrade button can be found in the site's settings and looks like this:" info:YES]]; - }); + } ); [context saveToStore]; }]; } @@ -418,11 +418,11 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { if (![self.fetchedResultsController performFetch:&error]) err( @"Couldn't fetch sites: %@", [error fullDescription] ); - PearlMainQueue(^{ + PearlMainQueue( ^{ @try { [self.passwordCollectionView performBatchUpdates:^{ [self fetchedItemsDidUpdate]; - + NSInteger fromSections = self.passwordCollectionView.numberOfSections; NSInteger toSections = [self numberOfSectionsInCollectionView:self.passwordCollectionView]; for (NSInteger section = 0; section < MAX( toSections, fromSections ); ++section) { @@ -449,7 +449,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) { wrn( @"While updating password cells: %@", [exception fullDescription] ); [self.passwordCollectionView reloadData]; } - }); + } ); }]; } diff --git a/platform-darwin/Source/iOS/MPPreferencesViewController.m b/platform-darwin/Source/iOS/MPPreferencesViewController.m index 53428289..ed3d35cb 100644 --- a/platform-darwin/Source/iOS/MPPreferencesViewController.m +++ b/platform-darwin/Source/iOS/MPPreferencesViewController.m @@ -90,7 +90,7 @@ [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { if ([[MPiOSAppDelegate get] findAndFixInconsistenciesSaveInContext:context] == MPFixableResultNoProblems) [PearlAlert showAlertWithTitle:@"No Inconsistencies" message: - @"No inconsistencies were detected in your sites." + @"No inconsistencies were detected in your sites." viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil]; }]; @@ -111,9 +111,9 @@ [[MPiOSAppDelegate get] forgetSavedKeyFor:activeUser]; [context saveToStore]; - PearlMainQueue(^{ + PearlMainQueue( ^{ [self reload]; - }); + } ); }]; if (sender == self.touchIDSwitch) @@ -241,7 +241,7 @@ return MPSiteTypeStoredDevicePrivate; default: Throw( @"unsupported selected type index: generated=%ld, stored=%ld", (long)selectedGeneratedIndex, - (long)selectedStoredIndex ); + (long)selectedStoredIndex ); } } } diff --git a/platform-darwin/Source/iOS/MPRootSegue.h b/platform-darwin/Source/iOS/MPRootSegue.h index c05b9b5f..7c11bee8 100644 --- a/platform-darwin/Source/iOS/MPRootSegue.h +++ b/platform-darwin/Source/iOS/MPRootSegue.h @@ -18,8 +18,6 @@ #import - @interface MPRootSegue : UIStoryboardSegue - @end diff --git a/platform-darwin/Source/iOS/MPRootSegue.m b/platform-darwin/Source/iOS/MPRootSegue.m index 4ec3fb5b..e1215797 100644 --- a/platform-darwin/Source/iOS/MPRootSegue.m +++ b/platform-darwin/Source/iOS/MPRootSegue.m @@ -18,9 +18,7 @@ #import "MPRootSegue.h" - @implementation MPRootSegue { - } - (void)perform { diff --git a/platform-darwin/Source/iOS/MPTypeViewController.m b/platform-darwin/Source/iOS/MPTypeViewController.m index 9a48129f..472f1de7 100644 --- a/platform-darwin/Source/iOS/MPTypeViewController.m +++ b/platform-darwin/Source/iOS/MPTypeViewController.m @@ -22,7 +22,7 @@ - (void)viewWillAppear:(BOOL)animated { - inf(@"Type selection will appear"); + inf( @"Type selection will appear" ); self.recommendedTipContainer.alpha = 0; [super viewWillAppear:animated]; @@ -55,7 +55,7 @@ - (void)viewWillDisappear:(BOOL)animated { - inf(@"Type selection will disappear"); + inf( @"Type selection will disappear" ); [super viewWillDisappear:animated]; } @@ -94,11 +94,11 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - NSAssert(self.navigationController.topViewController == self, @"Not the currently active navigation item."); + NSAssert( self.navigationController.topViewController == self, @"Not the currently active navigation item." ); MPSiteType type = [self typeAtIndexPath:indexPath]; if (type == (MPSiteType)NSNotFound) - // Selected a non-type row. + // Selected a non-type row. return; [self.delegate didSelectType:type]; @@ -129,7 +129,7 @@ return (MPSiteType)NSNotFound; default: { - Throw(@"Unsupported row: %ld, when selecting generated site type.", (long)indexPath.row); + Throw( @"Unsupported row: %ld, when selecting generated site type.", (long)indexPath.row ); } } } @@ -147,13 +147,13 @@ return (MPSiteType)NSNotFound; default: { - Throw(@"Unsupported row: %ld, when selecting stored site type.", (long)indexPath.row); + Throw( @"Unsupported row: %ld, when selecting stored site type.", (long)indexPath.row ); } } } default: - Throw(@"Unsupported section: %ld, when selecting site type.", (long)indexPath.section); + Throw( @"Unsupported section: %ld, when selecting site type.", (long)indexPath.section ); } } diff --git a/platform-darwin/Source/iOS/MPUsersViewController.h b/platform-darwin/Source/iOS/MPUsersViewController.h index be5a3d02..ad70f5bf 100644 --- a/platform-darwin/Source/iOS/MPUsersViewController.h +++ b/platform-darwin/Source/iOS/MPUsersViewController.h @@ -16,7 +16,7 @@ // Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. // -@interface MPUsersViewController : UIViewController +@interface MPUsersViewController : UIViewController @property(weak, nonatomic) IBOutlet UIView *userSelectionContainer; @property(weak, nonatomic) IBOutlet UIButton *marqueeButton; diff --git a/platform-darwin/Source/iOS/MPWebViewController.h b/platform-darwin/Source/iOS/MPWebViewController.h index 2bbf6286..a7b02cfd 100644 --- a/platform-darwin/Source/iOS/MPWebViewController.h +++ b/platform-darwin/Source/iOS/MPWebViewController.h @@ -18,8 +18,7 @@ #import - -@interface MPWebViewController : UIViewController +@interface MPWebViewController : UIViewController @property(nonatomic) IBOutlet UIWebView *webView; @property(nonatomic) IBOutlet UINavigationItem *webNavigationItem; diff --git a/platform-darwin/Source/iOS/MPiOSAppDelegate.h b/platform-darwin/Source/iOS/MPiOSAppDelegate.h index 617fe7e9..cf0215ae 100644 --- a/platform-darwin/Source/iOS/MPiOSAppDelegate.h +++ b/platform-darwin/Source/iOS/MPiOSAppDelegate.h @@ -16,6 +16,6 @@ - (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController; - (void)showExportForVC:(UIViewController *)viewController; -- (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void (^)(void))didReset; +- (void)changeMasterPasswordFor:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc didResetBlock:(void ( ^ )(void))didReset; @end diff --git a/platform-darwin/Source/iOS/MPiOSAppDelegate.m b/platform-darwin/Source/iOS/MPiOSAppDelegate.m index 5031788e..6a300215 100644 --- a/platform-darwin/Source/iOS/MPiOSAppDelegate.m +++ b/platform-darwin/Source/iOS/MPiOSAppDelegate.m @@ -42,7 +42,7 @@ #ifdef CRASHLYTICS NSString *crashlyticsAPIKey = [self crashlyticsAPIKey]; if ([crashlyticsAPIKey length]) { - inf(@"Initializing Crashlytics"); + inf( @"Initializing Crashlytics" ); #if defined (DEBUG) || defined (ADHOC) [Crashlytics sharedInstance].debugMode = YES; #endif @@ -82,12 +82,12 @@ #ifdef ADHOC [PearlAlert showAlertWithTitle:@"Welcome, tester!" message: - @"Thank you for taking the time to test Master Password.\n\n" - @"Please provide any feedback, however minor it may seem, via the Feedback action item accessible from the top right.\n\n" - @"Contact me directly at:\n" - @"lhunath@lyndir.com\n" - @"Or report detailed issues at:\n" - @"https://youtrack.lyndir.com\n" + @"Thank you for taking the time to test Master Password.\n\n" + @"Please provide any feedback, however minor it may seem, via the Feedback action item accessible from the top right.\n\n" + @"Contact me directly at:\n" + @"lhunath@lyndir.com\n" + @"Or report detailed issues at:\n" + @"https://youtrack.lyndir.com\n" viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:nil cancelTitle:nil otherTitles:[PearlStrings get].commonButtonOkay, nil]; #endif diff --git a/platform-darwin/Source/iOS/MPiOSConfig.m b/platform-darwin/Source/iOS/MPiOSConfig.m index 3359b61c..8e94e919 100644 --- a/platform-darwin/Source/iOS/MPiOSConfig.m +++ b/platform-darwin/Source/iOS/MPiOSConfig.m @@ -17,16 +17,16 @@ return self; [self.defaults registerDefaults:@{ - NSStringFromSelector( @selector( helpHidden ) ) : @NO, - NSStringFromSelector( @selector( siteInfoHidden ) ) : @YES, - NSStringFromSelector( @selector( showSetup ) ) : @YES, - NSStringFromSelector( @selector( appleID ) ) : @"510296984", - NSStringFromSelector( @selector( actionsTipShown ) ) : @(!self.firstRun), - NSStringFromSelector( @selector( typeTipShown ) ) : @(!self.firstRun), - NSStringFromSelector( @selector( loginNameTipShown ) ) : @NO, - NSStringFromSelector( @selector( traceMode ) ) : @NO, - NSStringFromSelector( @selector( dictationSearch ) ) : @NO, - NSStringFromSelector( @selector( allowDowngrade ) ) : @NO, + NSStringFromSelector( @selector( helpHidden ) ) : @NO, + NSStringFromSelector( @selector( siteInfoHidden ) ) : @YES, + NSStringFromSelector( @selector( showSetup ) ) : @YES, + NSStringFromSelector( @selector( appleID ) ) : @"510296984", + NSStringFromSelector( @selector( actionsTipShown ) ) : @(!self.firstRun), + NSStringFromSelector( @selector( typeTipShown ) ) : @(!self.firstRun), + NSStringFromSelector( @selector( loginNameTipShown ) ): @NO, + NSStringFromSelector( @selector( traceMode ) ) : @NO, + NSStringFromSelector( @selector( dictationSearch ) ) : @NO, + NSStringFromSelector( @selector( allowDowngrade ) ) : @NO, }]; return self; diff --git a/platform-darwin/Source/iOS/NSString+MPMarkDown.m b/platform-darwin/Source/iOS/NSString+MPMarkDown.m index 41fad7e7..901e5f0b 100644 --- a/platform-darwin/Source/iOS/NSString+MPMarkDown.m +++ b/platform-darwin/Source/iOS/NSString+MPMarkDown.m @@ -25,20 +25,20 @@ - (NSAttributedString *)attributedMarkdownStringWithFontSize:(CGFloat)fontSize { NSMutableAttributedString *attributedString = markdown_to_attr_string( self, 0, @{ - @(EMPH) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Bold" size:fontSize] }, - @(STRONG) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] }, - @(EMPH | STRONG) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] }, - @(PLAIN) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Regular" size:fontSize] }, - @(H1) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 2.f] }, - @(H2) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.5f] }, - @(H3) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, - @(H4) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.f] }, - @(H5) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .83f] }, - @(H6) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .75f] }, - @(BLOCKQUOTE) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, - @(CODE) : @{ NSFontAttributeName : [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] }, - @(VERBATIM) : @{ NSFontAttributeName : [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] }, - @(NOTE) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, + @(EMPH) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Bold" size:fontSize] }, + @(STRONG) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] }, + @(EMPH | STRONG): @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] }, + @(PLAIN) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Regular" size:fontSize] }, + @(H1) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 2.f] }, + @(H2) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.5f] }, + @(H3) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, + @(H4) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.f] }, + @(H5) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .83f] }, + @(H6) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .75f] }, + @(BLOCKQUOTE) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, + @(CODE) : @{ NSFontAttributeName: [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] }, + @(VERBATIM) : @{ NSFontAttributeName: [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] }, + @(NOTE) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, } ); // Trim trailing newlines.