2
0

Reformat to AppCode style.

This commit is contained in:
Maarten Billemont 2017-04-01 00:30:25 -04:00
parent de4300c3d3
commit 559934607b
56 changed files with 180 additions and 196 deletions

View File

@ -82,7 +82,7 @@ NSString *NSStringFromTimeToCrack(TimeToCrack timeToCrack);
- (void)resolvePasswordForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey - (void)resolvePasswordForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey
result:(void ( ^ )(NSString *result))resultBlock; result:(void ( ^ )(NSString *result))resultBlock;
- (void)resolveAnswerForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey - (void)resolveAnswerForSite:(MPSiteEntity *)site usingKey:(MPKey *)siteKey
result:(void ( ^ )(NSString *result))resultBlock; result:(void ( ^ )(NSString *result))resultBlock;
- (void)resolveAnswerForQuestion:(MPSiteQuestionEntity *)question usingKey:(MPKey *)siteKey - (void)resolveAnswerForQuestion:(MPSiteQuestionEntity *)question usingKey:(MPKey *)siteKey
result:(void ( ^ )(NSString *result))resultBlock; result:(void ( ^ )(NSString *result))resultBlock;

View File

@ -426,7 +426,7 @@ NSOperationQueue *_mpwQueue = nil;
[PearlKeyChain deleteItemForQuery:siteQuery]; [PearlKeyChain deleteItemForQuery:siteQuery];
else else
[PearlKeyChain addOrUpdateItemForQuery:siteQuery withAttributes:@{ [PearlKeyChain addOrUpdateItemForQuery:siteQuery withAttributes:@{
(__bridge id)kSecValueData : encryptedContent, (__bridge id)kSecValueData: encryptedContent,
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
(__bridge id)kSecAttrAccessible : (__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly, (__bridge id)kSecAttrAccessible : (__bridge id)kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
#endif #endif
@ -730,8 +730,8 @@ NSOperationQueue *_mpwQueue = nil;
return [PearlKeyChain createQueryForClass:kSecClassGenericPassword return [PearlKeyChain createQueryForClass:kSecClassGenericPassword
attributes:@{ attributes:@{
(__bridge id)kSecAttrService : @"DevicePrivate", (__bridge id)kSecAttrService: @"DevicePrivate",
(__bridge id)kSecAttrAccount : name (__bridge id)kSecAttrAccount: name
} }
matches:nil]; matches:nil];
} }

View File

@ -33,7 +33,7 @@
if (!explicit) { if (!explicit) {
if (site.type & MPSiteTypeClassGenerated && 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. // This migration requires explicit permission for types of the generated class.
site.requiresExplicitMigration = YES; site.requiresExplicitMigration = YES;
return NO; return NO;

View File

@ -49,8 +49,8 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
return [PearlKeyChain createQueryForClass:kSecClassGenericPassword return [PearlKeyChain createQueryForClass:kSecClassGenericPassword
attributes:@{ attributes:@{
(__bridge id)kSecAttrService : @"Saved Master Password", (__bridge id)kSecAttrService: @"Saved Master Password",
(__bridge id)kSecAttrAccount : user.name?: @"", (__bridge id)kSecAttrAccount: user.name?: @"",
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
(__bridge id)kSecAttrAccessible : (__bridge id)(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly?: kSecAttrAccessibleWhenUnlockedThisDeviceOnly), (__bridge id)kSecAttrAccessible : (__bridge id)(kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly?: kSecAttrAccessibleWhenUnlockedThisDeviceOnly),
#endif #endif
@ -81,7 +81,7 @@ static NSDictionary *createKeyQuery(MPUserEntity *user, BOOL newItem, MPKeyOrigi
inf( @"Saving key in keychain for user: %@", user.userID ); inf( @"Saving key in keychain for user: %@", user.userID );
[PearlKeyChain addOrUpdateItemForQuery:createKeyQuery( user, YES, nil ) [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.key = nil;
self.activeUser = 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 { - (BOOL)signInAsUser:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc usingMasterPassword:(NSString *)password {

View File

@ -11,7 +11,9 @@
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
@interface MPAppDelegate_Shared : PearlAppDelegate @interface MPAppDelegate_Shared : PearlAppDelegate
#else #else
@interface MPAppDelegate_Shared : NSObject <PearlConfigDelegate>
@interface MPAppDelegate_Shared : NSObject<PearlConfigDelegate>
#endif #endif
@property(strong, nonatomic, readonly) MPKey *key; @property(strong, nonatomic, readonly) MPKey *key;

View File

@ -11,7 +11,7 @@
#import "MPAppDelegate_Key.h" #import "MPAppDelegate_Key.h"
#import "NSManagedObjectModel+KCOrderedAccessorFix.h" #import "NSManagedObjectModel+KCOrderedAccessorFix.h"
@interface MPAppDelegate_Shared () @interface MPAppDelegate_Shared()
@property(strong, nonatomic) MPKey *key; @property(strong, nonatomic) MPKey *key;
@property(strong, nonatomic) NSManagedObjectID *activeUserOID; @property(strong, nonatomic) NSManagedObjectID *activeUserOID;
@ -66,13 +66,12 @@
NSError *error; NSError *error;
if (activeUser.objectID.isTemporaryID && ![activeUser.managedObjectContext obtainPermanentIDsForObjects:@[ activeUser ] error:&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; self.activeUserOID = activeUser.objectID;
} }
- (void)handleCoordinatorError:(NSError *)error { - (void)handleCoordinatorError:(NSError *)error {
} }
@end @end

View File

@ -21,10 +21,10 @@ typedef NS_ENUM( NSUInteger, MPImportResult ) {
@interface MPAppDelegate_Shared(Store) @interface MPAppDelegate_Shared(Store)
+ (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady; + (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady;
+ (BOOL)managedObjectContextForMainThreadPerformBlock:(void (^)(NSManagedObjectContext *mainContext))mocBlock; + (BOOL)managedObjectContextForMainThreadPerformBlock:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock;
+ (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void (^)(NSManagedObjectContext *mainContext))mocBlock; + (BOOL)managedObjectContextForMainThreadPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *mainContext))mocBlock;
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock; + (BOOL)managedObjectContextPerformBlock:(void ( ^ )(NSManagedObjectContext *context))mocBlock;
+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock; + (BOOL)managedObjectContextPerformBlockAndWait:(void ( ^ )(NSManagedObjectContext *context))mocBlock;
- (MPFixableResult)findAndFixInconsistenciesSaveInContext:(NSManagedObjectContext *)context; - (MPFixableResult)findAndFixInconsistenciesSaveInContext:(NSManagedObjectContext *)context;
- (void)deleteAndResetStore; - (void)deleteAndResetStore;
@ -33,8 +33,8 @@ typedef NS_ENUM( NSUInteger, MPImportResult ) {
- (void)addSiteNamed:(NSString *)siteName completion:(void ( ^ )(MPSiteEntity *site, NSManagedObjectContext *context))completion; - (void)addSiteNamed:(NSString *)siteName completion:(void ( ^ )(MPSiteEntity *site, NSManagedObjectContext *context))completion;
- (MPSiteEntity *)changeSite:(MPSiteEntity *)site saveInContext:(NSManagedObjectContext *)context toType:(MPSiteType)type; - (MPSiteEntity *)changeSite:(MPSiteEntity *)site saveInContext:(NSManagedObjectContext *)context toType:(MPSiteType)type;
- (MPImportResult)importSites:(NSString *)importedSitesString - (MPImportResult)importSites:(NSString *)importedSitesString
askImportPassword:(NSString *(^)(NSString *userName))importPassword askImportPassword:(NSString *( ^ )(NSString *userName))importPassword
askUserPassword:(NSString *(^)(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword; askUserPassword:(NSString *( ^ )(NSString *userName, NSUInteger importCount, NSUInteger deleteCount))userPassword;
- (NSString *)exportSitesRevealPasswords:(BOOL)revealPasswords; - (NSString *)exportSitesRevealPasswords:(BOOL)revealPasswords;
@end @end

View File

@ -211,8 +211,8 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
} }
if (![self.storeCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self localStoreURL] if (![self.storeCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:[self localStoreURL]
options:@{ options:@{
NSMigratePersistentStoresAutomaticallyOption : @YES, NSMigratePersistentStoresAutomaticallyOption: @YES,
NSInferMappingModelAutomaticallyOption : @YES, NSInferMappingModelAutomaticallyOption : @YES,
STORE_OPTIONS STORE_OPTIONS
} error:&error]) { } error:&error]) {
err( @"Failed to open store: %@", [error fullDescription] ); err( @"Failed to open store: %@", [error fullDescription] );
@ -292,7 +292,7 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
else { else {
[context saveToStore]; [context saveToStore];
[[NSNotificationCenter defaultCenter] postNotificationName:MPFoundInconsistenciesNotification object:nil userInfo:@{ [[NSNotificationCenter defaultCenter] postNotificationName:MPFoundInconsistenciesNotification object:nil userInfo:@{
MPInconsistenciesFixResultUserKey : @(result) MPInconsistenciesFixResultUserKey: @(result)
}]; }];
} }
@ -383,12 +383,12 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
NSError *error = nil; NSError *error = nil;
if (![NSPersistentStore migrateStore:oldLocalStoreURL withOptions:@{ if (![NSPersistentStore migrateStore:oldLocalStoreURL withOptions:@{
NSMigratePersistentStoresAutomaticallyOption : @YES, NSMigratePersistentStoresAutomaticallyOption: @YES,
NSInferMappingModelAutomaticallyOption : @YES, NSInferMappingModelAutomaticallyOption : @YES,
STORE_OPTIONS STORE_OPTIONS
} toStore:newLocalStoreURL withOptions:@{ } toStore:newLocalStoreURL withOptions:@{
NSMigratePersistentStoresAutomaticallyOption : @YES, NSMigratePersistentStoresAutomaticallyOption: @YES,
NSInferMappingModelAutomaticallyOption : @YES, NSInferMappingModelAutomaticallyOption : @YES,
STORE_OPTIONS STORE_OPTIONS
} model:nil error:&error]) { } model:nil error:&error]) {
err( @"Couldn't migrate the old store to the new location: %@", [error fullDescription] ); 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." ); inf( @"Import completed successfully." );
[[NSNotificationCenter defaultCenter] postNotificationName:MPSitesImportedNotification object:nil userInfo:@{ [[NSNotificationCenter defaultCenter] postNotificationName:MPSitesImportedNotification object:nil userInfo:@{
MPSitesImportedNotificationUserKey : user MPSitesImportedNotificationUserKey: user
}]; }];
return MPImportResultSuccess; return MPImportResultSuccess;

View File

@ -18,13 +18,13 @@
return nil; return nil;
[self.defaults registerDefaults:@{ [self.defaults registerDefaults:@{
NSStringFromSelector( @selector( askForReviews ) ) : @YES, NSStringFromSelector( @selector( askForReviews ) ) : @YES,
NSStringFromSelector( @selector( sendInfo ) ) : @NO, NSStringFromSelector( @selector( sendInfo ) ) : @NO,
NSStringFromSelector( @selector( rememberLogin ) ) : @NO, NSStringFromSelector( @selector( rememberLogin ) ) : @NO,
NSStringFromSelector( @selector( hidePasswords ) ) : @NO, NSStringFromSelector( @selector( hidePasswords ) ) : @NO,
NSStringFromSelector( @selector( checkInconsistency ) ) : @NO, NSStringFromSelector( @selector( checkInconsistency ) ): @NO,
NSStringFromSelector( @selector( siteAttacker ) ) : @(MPAttacker1), NSStringFromSelector( @selector( siteAttacker ) ) : @(MPAttacker1),
}]; }];
self.delegate = [MPAppDelegate_Shared get]; self.delegate = [MPAppDelegate_Shared get];

View File

@ -10,9 +10,8 @@
#import <CoreData/CoreData.h> #import <CoreData/CoreData.h>
#import "MPSiteEntity.h" #import "MPSiteEntity.h"
@interface MPGeneratedSiteEntity : MPSiteEntity @interface MPGeneratedSiteEntity : MPSiteEntity
@property (nonatomic, retain) NSNumber * counter_; @property(nonatomic, retain) NSNumber *counter_;
@end @end

View File

@ -8,7 +8,6 @@
#import "MPGeneratedSiteEntity.h" #import "MPGeneratedSiteEntity.h"
@implementation MPGeneratedSiteEntity @implementation MPGeneratedSiteEntity
@dynamic counter_; @dynamic counter_;

View File

@ -20,7 +20,7 @@
@protocol MPAlgorithm; @protocol MPAlgorithm;
typedef NS_ENUM(NSUInteger, MPKeyOrigin) { typedef NS_ENUM( NSUInteger, MPKeyOrigin ) {
MPKeyOriginMasterPassword, MPKeyOriginMasterPassword,
MPKeyOriginKeyChain, MPKeyOriginKeyChain,
MPKeyOriginKeyChainBiometric, MPKeyOriginKeyChainBiometric,

View File

@ -14,19 +14,19 @@
@interface MPSiteEntity : NSManagedObject @interface MPSiteEntity : NSManagedObject
//@property (nonatomic, retain) id content; // Hide here, reveal in MPStoredSiteEntity //@property (nonatomic, retain) id content; // Hide here, reveal in MPStoredSiteEntity
@property (nonatomic, retain) NSDate * lastUsed; @property(nonatomic, retain) NSDate *lastUsed;
@property (nonatomic, retain) NSNumber * loginGenerated_; @property(nonatomic, retain) NSNumber *loginGenerated_;
@property (nonatomic, retain) NSString * loginName; @property(nonatomic, retain) NSString *loginName;
@property (nonatomic, retain) NSString * name; @property(nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSNumber * requiresExplicitMigration_; @property(nonatomic, retain) NSNumber *requiresExplicitMigration_;
@property (nonatomic, retain) NSNumber * type_; @property(nonatomic, retain) NSNumber *type_;
@property (nonatomic, retain) NSNumber * uses_; @property(nonatomic, retain) NSNumber *uses_;
@property (nonatomic, retain) NSNumber * version_; @property(nonatomic, retain) NSNumber *version_;
@property (nonatomic, retain) NSOrderedSet *questions; @property(nonatomic, retain) NSOrderedSet *questions;
@property (nonatomic, retain) MPUserEntity *user; @property(nonatomic, retain) MPUserEntity *user;
@end @end
@interface MPSiteEntity (CoreDataGeneratedAccessors) @interface MPSiteEntity(CoreDataGeneratedAccessors)
- (void)insertObject:(MPSiteQuestionEntity *)value inQuestionsAtIndex:(NSUInteger)idx; - (void)insertObject:(MPSiteQuestionEntity *)value inQuestionsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromQuestionsAtIndex:(NSUInteger)idx; - (void)removeObjectFromQuestionsAtIndex:(NSUInteger)idx;

View File

@ -10,7 +10,6 @@
#import "MPSiteQuestionEntity.h" #import "MPSiteQuestionEntity.h"
#import "MPUserEntity.h" #import "MPUserEntity.h"
@implementation MPSiteEntity @implementation MPSiteEntity
//@dynamic content; //@dynamic content;

View File

@ -13,7 +13,7 @@
@interface MPSiteQuestionEntity : NSManagedObject @interface MPSiteQuestionEntity : NSManagedObject
@property (nonatomic, retain) NSString * keyword; @property(nonatomic, retain) NSString *keyword;
@property (nonatomic, retain) MPSiteEntity *site; @property(nonatomic, retain) MPSiteEntity *site;
@end @end

View File

@ -9,7 +9,6 @@
#import "MPSiteQuestionEntity.h" #import "MPSiteQuestionEntity.h"
#import "MPSiteEntity.h" #import "MPSiteEntity.h"
@implementation MPSiteQuestionEntity @implementation MPSiteQuestionEntity
@dynamic keyword; @dynamic keyword;

View File

@ -10,9 +10,8 @@
#import <CoreData/CoreData.h> #import <CoreData/CoreData.h>
#import "MPSiteEntity.h" #import "MPSiteEntity.h"
@interface MPStoredSiteEntity : MPSiteEntity @interface MPStoredSiteEntity : MPSiteEntity
@property (nonatomic, retain) NSData *contentObject; @property(nonatomic, retain) NSData *contentObject;
@end @end

View File

@ -8,7 +8,6 @@
#import "MPStoredSiteEntity.h" #import "MPStoredSiteEntity.h"
@implementation MPStoredSiteEntity @implementation MPStoredSiteEntity
@dynamic contentObject; @dynamic contentObject;

View File

@ -13,18 +13,18 @@
@interface MPUserEntity : NSManagedObject @interface MPUserEntity : NSManagedObject
@property (nonatomic, retain) NSNumber * avatar_; @property(nonatomic, retain) NSNumber *avatar_;
@property (nonatomic, retain) NSNumber * defaultType_; @property(nonatomic, retain) NSNumber *defaultType_;
@property (nonatomic, retain) NSData * keyID; @property(nonatomic, retain) NSData *keyID;
@property (nonatomic, retain) NSDate * lastUsed; @property(nonatomic, retain) NSDate *lastUsed;
@property (nonatomic, retain) NSString * name; @property(nonatomic, retain) NSString *name;
@property (nonatomic, retain) NSNumber * saveKey_; @property(nonatomic, retain) NSNumber *saveKey_;
@property (nonatomic, retain) NSNumber * touchID_; @property(nonatomic, retain) NSNumber *touchID_;
@property (nonatomic, retain) NSNumber * version_; @property(nonatomic, retain) NSNumber *version_;
@property (nonatomic, retain) NSSet *sites; @property(nonatomic, retain) NSSet *sites;
@end @end
@interface MPUserEntity (CoreDataGeneratedAccessors) @interface MPUserEntity(CoreDataGeneratedAccessors)
- (void)addSitesObject:(MPSiteEntity *)value; - (void)addSitesObject:(MPSiteEntity *)value;
- (void)removeSitesObject:(MPSiteEntity *)value; - (void)removeSitesObject:(MPSiteEntity *)value;

View File

@ -9,7 +9,6 @@
#import "MPUserEntity.h" #import "MPUserEntity.h"
#import "MPSiteEntity.h" #import "MPSiteEntity.h"
@implementation MPUserEntity @implementation MPUserEntity
@dynamic avatar_; @dynamic avatar_;

View File

@ -30,8 +30,8 @@
[[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:self.window [[NSNotificationCenter defaultCenter] addObserverForName:NSWindowWillCloseNotification object:self.window
queue:nil usingBlock:^(NSNotification *note) { queue:nil usingBlock:^(NSNotification *note) {
[MPMacAppDelegate get].initialWindowController = nil; [MPMacAppDelegate get].initialWindowController = nil;
}]; }];
} }
#pragma mark - Actions #pragma mark - Actions

View File

@ -123,12 +123,10 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
^(MPMacAppDelegate *self, NSNotification *note) { ^(MPMacAppDelegate *self, NSNotification *note) {
PearlMainQueue( ^{ PearlMainQueue( ^{
NSString *key = note.object; NSString *key = note.object;
if (!key || [key isEqualToString:NSStringFromSelector( @ if (!key || [key isEqualToString:NSStringFromSelector( @selector( hidePasswords ) )])
selector( hidePasswords ) )]) self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState;
self.hidePasswordsItem.state = [[MPConfig get].hidePasswords boolValue]? NSOnState: NSOffState; if (!key || [key isEqualToString:NSStringFromSelector( @selector( rememberLogin ) )])
if (!key || [key isEqualToString:NSStringFromSelector( @ self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
selector( rememberLogin ) )])
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
} ); } );
} ); } );
[self updateUsers]; [self updateUsers];
@ -136,7 +134,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
// Global hotkey. // Global hotkey.
EventHotKeyRef hotKeyRef; EventHotKeyRef hotKeyRef;
EventTypeSpec hotKeyEvents[1] = { { .eventClass = kEventClassKeyboard, .eventKind = kEventHotKeyPressed } }; 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) if (status != noErr)
err( @"Error installing application event handler: %i", (int)status ); err( @"Error installing application event handler: %i", (int)status );
status = RegisterEventHotKey( 35 /* p */, controlKey + cmdKey, MPShowHotKey, GetApplicationEventTarget(), 0, &hotKeyRef ); status = RegisterEventHotKey( 35 /* p */, controlKey + cmdKey, MPShowHotKey, GetApplicationEventTarget(), 0, &hotKeyRef );
@ -318,17 +317,17 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
break; break;
case MPImportResultInternalError: case MPImportResultInternalError:
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ [[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]; }]] runModal];
break; break;
case MPImportResultMalformedInput: case MPImportResultMalformedInput:
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ [[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]; }]] runModal];
break; break;
case MPImportResultInvalidPassword: case MPImportResultInvalidPassword:
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ [[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]; }]] runModal];
break; break;
} }
@ -441,7 +440,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
prof_new( @"showPasswordWindow" ); prof_new( @"showPasswordWindow" );
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];
prof_rewind(@"activateIgnoringOtherApps"); prof_rewind( @"activateIgnoringOtherApps" );
// If no user, can't activate. // If no user, can't activate.
if (![self activeUserForMainThread]) { if (![self activeUserForMainThread]) {

View File

@ -5,7 +5,7 @@
#import "MPMacApplication.h" #import "MPMacApplication.h"
@interface NSResponder (Editing) @interface NSResponder(Editing)
- (void)undo:(id)sender; - (void)undo:(id)sender;
- (void)redo:(id)sender; - (void)redo:(id)sender;

View File

@ -17,8 +17,8 @@
return self; return self;
[self.defaults registerDefaults:@{ [self.defaults registerDefaults:@{
NSStringFromSelector( @selector( appleID ) ) : @"510296984", NSStringFromSelector( @selector( appleID ) ) : @"510296984",
NSStringFromSelector( @selector( fullScreen ) ) : @YES, NSStringFromSelector( @selector( fullScreen ) ): @YES,
}]; }];
return self; return self;

View File

@ -18,6 +18,5 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface MPNoStateButtonCell : NSButtonCell @interface MPNoStateButtonCell : NSButtonCell
@end @end

View File

@ -18,9 +18,7 @@
#import "MPNoStateButton.h" #import "MPNoStateButton.h"
@implementation MPNoStateButtonCell { @implementation MPNoStateButtonCell {
} }
- (void)setState:(NSInteger)state { - (void)setState:(NSInteger)state {

View File

@ -18,7 +18,6 @@
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
@interface MPPasswordWindow : NSWindow @interface MPPasswordWindow : NSWindow
@end @end

View File

@ -37,7 +37,7 @@
} }
else if (self.level != NSNormalWindowLevel) { else if (self.level != NSNormalWindowLevel) {
[self setLevel:NSNormalWindowLevel]; [self setLevel:NSNormalWindowLevel];
[self setFrame:NSMakeRect( 0, 0, 640, 600) display:NO]; [self setFrame:NSMakeRect( 0, 0, 640, 600 ) display:NO];
[self center]; [self center];
} }

View File

@ -173,7 +173,7 @@
[self.progressView stopAnimation:self]; [self.progressView stopAnimation:self];
if (!success) if (!success)
[[NSAlert alertWithError:[NSError errorWithDomain:MPErrorDomain code:0 userInfo:@{ [[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]; }]] beginSheetModalForWindow:self.window completionHandler:nil];
} ); } );
}]; }];

View File

@ -25,25 +25,25 @@
@interface MPSiteModel : NSObject @interface MPSiteModel : NSObject
@property (nonatomic) NSString *name; @property(nonatomic) NSString *name;
@property (nonatomic) NSAttributedString *displayedName; @property(nonatomic) NSAttributedString *displayedName;
@property (nonatomic) MPSiteType type; @property(nonatomic) MPSiteType type;
@property (nonatomic) NSString *typeName; @property(nonatomic) NSString *typeName;
@property (nonatomic) NSString *content; @property(nonatomic) NSString *content;
@property (nonatomic) NSString *displayedContent; @property(nonatomic) NSString *displayedContent;
@property (nonatomic) NSString *question; @property(nonatomic) NSString *question;
@property (nonatomic) NSString *answer; @property(nonatomic) NSString *answer;
@property (nonatomic) NSString *loginName; @property(nonatomic) NSString *loginName;
@property (nonatomic) BOOL loginGenerated; @property(nonatomic) BOOL loginGenerated;
@property (nonatomic) NSNumber *uses; @property(nonatomic) NSNumber *uses;
@property (nonatomic) NSUInteger counter; @property(nonatomic) NSUInteger counter;
@property (nonatomic) NSDate *lastUsed; @property(nonatomic) NSDate *lastUsed;
@property (nonatomic) id<MPAlgorithm> algorithm; @property(nonatomic) id<MPAlgorithm> algorithm;
@property (nonatomic) MPAlgorithmVersion algorithmVersion; @property(nonatomic) MPAlgorithmVersion algorithmVersion;
@property (nonatomic, readonly) BOOL outdated; @property(nonatomic, readonly) BOOL outdated;
@property (nonatomic, readonly) BOOL generated; @property(nonatomic, readonly) BOOL generated;
@property (nonatomic, readonly) BOOL stored; @property(nonatomic, readonly) BOOL stored;
@property (nonatomic, readonly) BOOL transient; @property(nonatomic, readonly) BOOL transient;
- (instancetype)initWithEntity:(MPSiteEntity *)entity fuzzyGroups:(NSArray *)fuzzyGroups; - (instancetype)initWithEntity:(MPSiteEntity *)entity fuzzyGroups:(NSArray *)fuzzyGroups;
- (instancetype)initWithName:(NSString *)siteName forUser:(MPUserEntity *)user; - (instancetype)initWithName:(NSString *)siteName forUser:(MPUserEntity *)user;

View File

@ -93,8 +93,8 @@
NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new]; NSMutableParagraphStyle *paragraphStyle = [NSMutableParagraphStyle new];
paragraphStyle.alignment = NSCenterTextAlignment; paragraphStyle.alignment = NSCenterTextAlignment;
self.displayedName = stra( siteName, @{ self.displayedName = stra( siteName, @{
NSBackgroundColorAttributeName : [NSColor alternateSelectedControlColor], NSBackgroundColorAttributeName: [NSColor alternateSelectedControlColor],
NSParagraphStyleAttributeName : paragraphStyle, NSParagraphStyleAttributeName : paragraphStyle,
} ); } );
self.name = siteName; self.name = siteName;
self.algorithm = MPAlgorithmDefault; self.algorithm = MPAlgorithmDefault;

View File

@ -12,7 +12,7 @@
@interface MPAnswersViewController : UIViewController @interface MPAnswersViewController : UIViewController
@property (nonatomic) IBOutlet UITableView *tableView; @property(nonatomic) IBOutlet UITableView *tableView;
- (void)setSite:(MPSiteEntity *)site; - (void)setSite:(MPSiteEntity *)site;
- (MPSiteEntity *)siteInContext:(NSManagedObjectContext *)context; - (MPSiteEntity *)siteInContext:(NSManagedObjectContext *)context;
@ -21,8 +21,8 @@
@interface MPGlobalAnswersCell : UITableViewCell @interface MPGlobalAnswersCell : UITableViewCell
@property (nonatomic) IBOutlet UILabel *titleLabel; @property(nonatomic) IBOutlet UILabel *titleLabel;
@property (nonatomic) IBOutlet UITextField *answerField; @property(nonatomic) IBOutlet UITextField *answerField;
- (void)setSite:(MPSiteEntity *)site; - (void)setSite:(MPSiteEntity *)site;
@ -32,7 +32,7 @@
@end @end
@interface MPMultipleAnswersCell : UITableViewCell <UITextFieldDelegate> @interface MPMultipleAnswersCell : UITableViewCell<UITextFieldDelegate>
@end @end

View File

@ -23,7 +23,7 @@
/* Avatar with a "+" symbol. */ /* Avatar with a "+" symbol. */
extern const long MPAvatarAdd; extern const long MPAvatarAdd;
typedef NS_ENUM(NSUInteger, MPAvatarMode) { typedef NS_ENUM( NSUInteger, MPAvatarMode ) {
MPAvatarModeLowered, MPAvatarModeLowered,
MPAvatarModeRaisedButInactive, MPAvatarModeRaisedButInactive,
MPAvatarModeRaisedAndActive, MPAvatarModeRaisedAndActive,
@ -32,12 +32,13 @@ typedef NS_ENUM(NSUInteger, MPAvatarMode) {
}; };
@interface MPAvatarCell : UICollectionViewCell @interface MPAvatarCell : UICollectionViewCell
@property (copy, nonatomic) NSString *name;
@property (assign, nonatomic) NSUInteger avatar; @property(copy, nonatomic) NSString *name;
@property (assign, nonatomic) MPAvatarMode mode; @property(assign, nonatomic) NSUInteger avatar;
@property (assign, nonatomic) CGFloat visibility; @property(assign, nonatomic) MPAvatarMode mode;
@property (assign, nonatomic) BOOL spinnerActive; @property(assign, nonatomic) CGFloat visibility;
@property (assign, nonatomic, readonly) BOOL newUser; @property(assign, nonatomic) BOOL spinnerActive;
@property(assign, nonatomic, readonly) BOOL newUser;
+ (NSString *)reuseIdentifier; + (NSString *)reuseIdentifier;

View File

@ -20,7 +20,7 @@
#import "MPPasswordsViewController.h" #import "MPPasswordsViewController.h"
#import "MPEmergencyViewController.h" #import "MPEmergencyViewController.h"
typedef NS_ENUM(NSUInteger, MPCombinedMode) { typedef NS_ENUM( NSUInteger, MPCombinedMode ) {
MPCombinedModeUserSelection, MPCombinedModeUserSelection,
MPCombinedModePasswordSelection, MPCombinedModePasswordSelection,
}; };

View File

@ -131,7 +131,7 @@
[self.usersVC setActive:YES animated:animated]; [self.usersVC setActive:YES animated:animated];
if (_passwordsVC) { if (_passwordsVC) {
MPPasswordsSegue *segue = [[MPPasswordsSegue alloc] initWithIdentifier:@"passwords" source:_passwordsVC destination:self]; MPPasswordsSegue *segue = [[MPPasswordsSegue alloc] initWithIdentifier:@"passwords" source:_passwordsVC destination:self];
[self prepareForSegue:segue sender:@{ @"animated" : @(animated) }]; [self prepareForSegue:segue sender:@{ @"animated": @(animated) }];
[segue perform]; [segue perform];
} }
break; break;
@ -139,7 +139,7 @@
case MPCombinedModePasswordSelection: { case MPCombinedModePasswordSelection: {
self.usersVC.view.userInteractionEnabled = NO; self.usersVC.view.userInteractionEnabled = NO;
[self.usersVC setActive:NO animated:animated]; [self.usersVC setActive:NO animated:animated];
[self performSegueWithIdentifier:@"passwords" sender:@{ @"animated" : @(animated) }]; [self performSegueWithIdentifier:@"passwords" sender:@{ @"animated": @(animated) }];
break; break;
} }
} }

View File

@ -17,7 +17,7 @@
// //
@interface MPEmergencyViewController : UIViewController <UITextFieldDelegate> @interface MPEmergencyViewController : UIViewController<UITextFieldDelegate>
@property(weak, nonatomic) IBOutlet UIScrollView *scrollView; @property(weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property(weak, nonatomic) IBOutlet UIView *dialogView; @property(weak, nonatomic) IBOutlet UIView *dialogView;

View File

@ -20,8 +20,9 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface MPLogsViewController : UIViewController @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)toggleLevelControl:(UISegmentedControl *)sender;
- (IBAction)refresh:(UIBarButtonItem *)sender; - (IBAction)refresh:(UIBarButtonItem *)sender;

View File

@ -20,6 +20,6 @@
@interface MPMessageViewController : UIViewController @interface MPMessageViewController : UIViewController
@property (nonatomic) MPMessage *message; @property(nonatomic) MPMessage *message;
@end @end

View File

@ -18,6 +18,5 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface MPNavigationController : UINavigationController @interface MPNavigationController : UINavigationController
@end @end

View File

@ -18,7 +18,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface MPOverlayViewController : UIViewController @interface MPOverlayViewController : UIViewController
@end @end

View File

@ -80,7 +80,7 @@
for (NSValue *dismissButtonValue in [_dismissSegueByButton allKeys]) for (NSValue *dismissButtonValue in [_dismissSegueByButton allKeys])
if (((UIStoryboardSegue *)_dismissSegueByButton[dismissButtonValue]).sourceViewController == viewController) { if (((UIStoryboardSegue *)_dismissSegueByButton[dismissButtonValue]).sourceViewController == viewController) {
dismissButton = [dismissButtonValue nonretainedObjectValue]; 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) if (!dismissButton)
return; return;

View File

@ -25,9 +25,9 @@ typedef NS_ENUM ( NSUInteger, MPPasswordCellMode ) {
MPPasswordCellModeSettings, MPPasswordCellModeSettings,
}; };
@interface MPPasswordCell : MPCell <UIScrollViewDelegate, UITextFieldDelegate> @interface MPPasswordCell : MPCell<UIScrollViewDelegate, UITextFieldDelegate>
@property (nonatomic) NSArray *fuzzyGroups; @property(nonatomic) NSArray *fuzzyGroups;
- (void)setSite:(MPSiteEntity *)site animated:(BOOL)animated; - (void)setSite:(MPSiteEntity *)site animated:(BOOL)animated;
- (void)setTransientSite:(NSString *)siteName animated:(BOOL)animated; - (void)setTransientSite:(NSString *)siteName animated:(BOOL)animated;

View File

@ -532,7 +532,7 @@
self.passwordField.attributedPlaceholder = stra( self.passwordField.attributedPlaceholder = stra(
mainSite.type & MPSiteTypeClassStored? strl( @"No password" ): mainSite.type & MPSiteTypeClassStored? strl( @"No password" ):
mainSite.type & MPSiteTypeClassGenerated? strl( @"..." ): @"", @{ mainSite.type & MPSiteTypeClassGenerated? strl( @"..." ): @"", @{
NSForegroundColorAttributeName : [UIColor whiteColor] NSForegroundColorAttributeName: [UIColor whiteColor]
} ); } );
[MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
MPSiteEntity *site = [self siteInContext:context]; MPSiteEntity *site = [self siteInContext:context];
@ -570,8 +570,8 @@
[self.modeScrollView addSubview:self.indicatorView]; [self.modeScrollView addSubview:self.indicatorView];
[self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX [self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX
metrics:nil views:@{ metrics:nil views:@{
@"indicator" : self.indicatorView, @"indicator": self.indicatorView,
@"target" : settingsMode? self.editButton: self.modeButton @"target" : settingsMode? self.editButton: self.modeButton
}]; }];
} }
else if (requiresExplicitMigration) { else if (requiresExplicitMigration) {
@ -580,8 +580,8 @@
[self.modeScrollView addSubview:self.indicatorView]; [self.modeScrollView addSubview:self.indicatorView];
[self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX [self.contentView addConstraintsWithVisualFormat:@"V:[indicator][target]" options:NSLayoutFormatAlignAllCenterX
metrics:nil views:@{ metrics:nil views:@{
@"indicator" : self.indicatorView, @"indicator": self.indicatorView,
@"target" : settingsMode? self.upgradeButton: self.modeButton @"target" : settingsMode? self.upgradeButton: self.modeButton
}]; }];
} }
else else
@ -617,7 +617,7 @@
} }
[attributedSiteName appendAttributedString:stra( [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; self.siteNameLabel.attributedText = attributedSiteName;
} }

View File

@ -20,6 +20,6 @@
@interface MPPasswordsSegue : UIStoryboardSegue @interface MPPasswordsSegue : UIStoryboardSegue
@property (nonatomic, assign) BOOL animated; @property(nonatomic, assign) BOOL animated;
@end @end

View File

@ -33,7 +33,7 @@
@property(assign, nonatomic) BOOL active; @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; - (void)updatePasswords;
- (IBAction)dismissPopdown:(id)sender; - (IBAction)dismissPopdown:(id)sender;

View File

@ -91,7 +91,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
[MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context]; MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:context];
if (![MPAlgorithmDefault tryMigrateUser:activeUser inContext:context]) if (![MPAlgorithmDefault tryMigrateUser:activeUser inContext:context])
PearlMainQueue(^{ PearlMainQueue( ^{
[self performSegueWithIdentifier:@"message" sender: [self performSegueWithIdentifier:@"message" sender:
[MPMessage messageWithTitle:@"You have sites that can be upgraded." text: [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" @"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" "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:" "The upgrade button can be found in the site's settings and looks like this:"
info:YES]]; info:YES]];
}); } );
[context saveToStore]; [context saveToStore];
}]; }];
} }
@ -418,7 +418,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
if (![self.fetchedResultsController performFetch:&error]) if (![self.fetchedResultsController performFetch:&error])
err( @"Couldn't fetch sites: %@", [error fullDescription] ); err( @"Couldn't fetch sites: %@", [error fullDescription] );
PearlMainQueue(^{ PearlMainQueue( ^{
@try { @try {
[self.passwordCollectionView performBatchUpdates:^{ [self.passwordCollectionView performBatchUpdates:^{
[self fetchedItemsDidUpdate]; [self fetchedItemsDidUpdate];
@ -449,7 +449,7 @@ typedef NS_OPTIONS( NSUInteger, MPPasswordsTips ) {
wrn( @"While updating password cells: %@", [exception fullDescription] ); wrn( @"While updating password cells: %@", [exception fullDescription] );
[self.passwordCollectionView reloadData]; [self.passwordCollectionView reloadData];
} }
}); } );
}]; }];
} }

View File

@ -90,7 +90,7 @@
[MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) { [MPiOSAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
if ([[MPiOSAppDelegate get] findAndFixInconsistenciesSaveInContext:context] == MPFixableResultNoProblems) if ([[MPiOSAppDelegate get] findAndFixInconsistenciesSaveInContext:context] == MPFixableResultNoProblems)
[PearlAlert showAlertWithTitle:@"No Inconsistencies" message: [PearlAlert showAlertWithTitle:@"No Inconsistencies" message:
@"No inconsistencies were detected in your sites." @"No inconsistencies were detected in your sites."
viewStyle:UIAlertViewStyleDefault initAlert:nil viewStyle:UIAlertViewStyleDefault initAlert:nil
tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil]; tappedButtonBlock:nil cancelTitle:[PearlStrings get].commonButtonOkay otherTitles:nil];
}]; }];
@ -111,9 +111,9 @@
[[MPiOSAppDelegate get] forgetSavedKeyFor:activeUser]; [[MPiOSAppDelegate get] forgetSavedKeyFor:activeUser];
[context saveToStore]; [context saveToStore];
PearlMainQueue(^{ PearlMainQueue( ^{
[self reload]; [self reload];
}); } );
}]; }];
if (sender == self.touchIDSwitch) if (sender == self.touchIDSwitch)
@ -241,7 +241,7 @@
return MPSiteTypeStoredDevicePrivate; return MPSiteTypeStoredDevicePrivate;
default: default:
Throw( @"unsupported selected type index: generated=%ld, stored=%ld", (long)selectedGeneratedIndex, Throw( @"unsupported selected type index: generated=%ld, stored=%ld", (long)selectedGeneratedIndex,
(long)selectedStoredIndex ); (long)selectedStoredIndex );
} }
} }
} }

View File

@ -18,8 +18,6 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface MPRootSegue : UIStoryboardSegue @interface MPRootSegue : UIStoryboardSegue
@end @end

View File

@ -18,9 +18,7 @@
#import "MPRootSegue.h" #import "MPRootSegue.h"
@implementation MPRootSegue { @implementation MPRootSegue {
} }
- (void)perform { - (void)perform {

View File

@ -22,7 +22,7 @@
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
inf(@"Type selection will appear"); inf( @"Type selection will appear" );
self.recommendedTipContainer.alpha = 0; self.recommendedTipContainer.alpha = 0;
[super viewWillAppear:animated]; [super viewWillAppear:animated];
@ -55,7 +55,7 @@
- (void)viewWillDisappear:(BOOL)animated { - (void)viewWillDisappear:(BOOL)animated {
inf(@"Type selection will disappear"); inf( @"Type selection will disappear" );
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
} }
@ -94,11 +94,11 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { - (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]; MPSiteType type = [self typeAtIndexPath:indexPath];
if (type == (MPSiteType)NSNotFound) if (type == (MPSiteType)NSNotFound)
// Selected a non-type row. // Selected a non-type row.
return; return;
[self.delegate didSelectType:type]; [self.delegate didSelectType:type];
@ -129,7 +129,7 @@
return (MPSiteType)NSNotFound; return (MPSiteType)NSNotFound;
default: { 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; return (MPSiteType)NSNotFound;
default: { 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: default:
Throw(@"Unsupported section: %ld, when selecting site type.", (long)indexPath.section); Throw( @"Unsupported section: %ld, when selecting site type.", (long)indexPath.section );
} }
} }

View File

@ -16,7 +16,7 @@
// Copyright, lhunath (Maarten Billemont) 2014. All rights reserved. // Copyright, lhunath (Maarten Billemont) 2014. All rights reserved.
// //
@interface MPUsersViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UITextFieldDelegate> @interface MPUsersViewController : UIViewController<UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, UITextFieldDelegate>
@property(weak, nonatomic) IBOutlet UIView *userSelectionContainer; @property(weak, nonatomic) IBOutlet UIView *userSelectionContainer;
@property(weak, nonatomic) IBOutlet UIButton *marqueeButton; @property(weak, nonatomic) IBOutlet UIButton *marqueeButton;

View File

@ -18,8 +18,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@interface MPWebViewController : UIViewController<UIWebViewDelegate>
@interface MPWebViewController : UIViewController <UIWebViewDelegate>
@property(nonatomic) IBOutlet UIWebView *webView; @property(nonatomic) IBOutlet UIWebView *webView;
@property(nonatomic) IBOutlet UINavigationItem *webNavigationItem; @property(nonatomic) IBOutlet UINavigationItem *webNavigationItem;

View File

@ -16,6 +16,6 @@
- (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController; - (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController;
- (void)showExportForVC:(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 @end

View File

@ -42,7 +42,7 @@
#ifdef CRASHLYTICS #ifdef CRASHLYTICS
NSString *crashlyticsAPIKey = [self crashlyticsAPIKey]; NSString *crashlyticsAPIKey = [self crashlyticsAPIKey];
if ([crashlyticsAPIKey length]) { if ([crashlyticsAPIKey length]) {
inf(@"Initializing Crashlytics"); inf( @"Initializing Crashlytics" );
#if defined (DEBUG) || defined (ADHOC) #if defined (DEBUG) || defined (ADHOC)
[Crashlytics sharedInstance].debugMode = YES; [Crashlytics sharedInstance].debugMode = YES;
#endif #endif
@ -82,12 +82,12 @@
#ifdef ADHOC #ifdef ADHOC
[PearlAlert showAlertWithTitle:@"Welcome, tester!" message: [PearlAlert showAlertWithTitle:@"Welcome, tester!" message:
@"Thank you for taking the time to test Master Password.\n\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" @"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" @"Contact me directly at:\n"
@"lhunath@lyndir.com\n" @"lhunath@lyndir.com\n"
@"Or report detailed issues at:\n" @"Or report detailed issues at:\n"
@"https://youtrack.lyndir.com\n" @"https://youtrack.lyndir.com\n"
viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:nil viewStyle:UIAlertViewStyleDefault initAlert:nil tappedButtonBlock:nil
cancelTitle:nil otherTitles:[PearlStrings get].commonButtonOkay, nil]; cancelTitle:nil otherTitles:[PearlStrings get].commonButtonOkay, nil];
#endif #endif

View File

@ -17,16 +17,16 @@
return self; return self;
[self.defaults registerDefaults:@{ [self.defaults registerDefaults:@{
NSStringFromSelector( @selector( helpHidden ) ) : @NO, NSStringFromSelector( @selector( helpHidden ) ) : @NO,
NSStringFromSelector( @selector( siteInfoHidden ) ) : @YES, NSStringFromSelector( @selector( siteInfoHidden ) ) : @YES,
NSStringFromSelector( @selector( showSetup ) ) : @YES, NSStringFromSelector( @selector( showSetup ) ) : @YES,
NSStringFromSelector( @selector( appleID ) ) : @"510296984", NSStringFromSelector( @selector( appleID ) ) : @"510296984",
NSStringFromSelector( @selector( actionsTipShown ) ) : @(!self.firstRun), NSStringFromSelector( @selector( actionsTipShown ) ) : @(!self.firstRun),
NSStringFromSelector( @selector( typeTipShown ) ) : @(!self.firstRun), NSStringFromSelector( @selector( typeTipShown ) ) : @(!self.firstRun),
NSStringFromSelector( @selector( loginNameTipShown ) ) : @NO, NSStringFromSelector( @selector( loginNameTipShown ) ): @NO,
NSStringFromSelector( @selector( traceMode ) ) : @NO, NSStringFromSelector( @selector( traceMode ) ) : @NO,
NSStringFromSelector( @selector( dictationSearch ) ) : @NO, NSStringFromSelector( @selector( dictationSearch ) ) : @NO,
NSStringFromSelector( @selector( allowDowngrade ) ) : @NO, NSStringFromSelector( @selector( allowDowngrade ) ) : @NO,
}]; }];
return self; return self;

View File

@ -25,20 +25,20 @@
- (NSAttributedString *)attributedMarkdownStringWithFontSize:(CGFloat)fontSize { - (NSAttributedString *)attributedMarkdownStringWithFontSize:(CGFloat)fontSize {
NSMutableAttributedString *attributedString = markdown_to_attr_string( self, 0, @{ NSMutableAttributedString *attributedString = markdown_to_attr_string( self, 0, @{
@(EMPH) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Bold" size:fontSize] }, @(EMPH) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Bold" size:fontSize] },
@(STRONG) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] }, @(STRONG) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-ExtraBold" size:fontSize] },
@(EMPH | 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] }, @(PLAIN) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Regular" size:fontSize] },
@(H1) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 2.f] }, @(H1) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 2.f] },
@(H2) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.5f] }, @(H2) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.5f] },
@(H3) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, @(H3) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] },
@(H4) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.f] }, @(H4) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.f] },
@(H5) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .83f] }, @(H5) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .83f] },
@(H6) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .75f] }, @(H6) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * .75f] },
@(BLOCKQUOTE) : @{ NSFontAttributeName : [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] }, @(BLOCKQUOTE) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] },
@(CODE) : @{ NSFontAttributeName : [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] }, @(CODE) : @{ NSFontAttributeName: [UIFont fontWithName:@"SourceCodePro-Regular" size:fontSize] },
@(VERBATIM) : @{ 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] }, @(NOTE) : @{ NSFontAttributeName: [UIFont fontWithName:@"Exo2.0-Thin" size:fontSize * 1.17f] },
} ); } );
// Trim trailing newlines. // Trim trailing newlines.