Retire use of confinement concurrency type.
[FIXED] Confinement concurrency type is just all sorts of buggy.
This commit is contained in:
parent
3cb8215d5a
commit
0813fb40d0
2
External/RHStatusItemView
vendored
2
External/RHStatusItemView
vendored
@ -1 +1 @@
|
|||||||
Subproject commit fa01dea4ec70d12a8b2db48e26b50271451a16e1
|
Subproject commit 039dc04e667199396765dd394b70e3f38f04ea33
|
@ -755,7 +755,7 @@ static NSString *ETagIfPresent(GTLObject *obj) {
|
|||||||
|
|
||||||
// Build up the array of RPC calls.
|
// Build up the array of RPC calls.
|
||||||
NSMutableArray *rpcPayloads = [NSMutableArray arrayWithCapacity:numberOfQueries];
|
NSMutableArray *rpcPayloads = [NSMutableArray arrayWithCapacity:numberOfQueries];
|
||||||
NSMutableArray *requestIDs = [NSMutableSet setWithCapacity:numberOfQueries];
|
NSMutableSet *requestIDs = [NSMutableSet setWithCapacity:numberOfQueries];
|
||||||
for (GTLQuery *query in queries) {
|
for (GTLQuery *query in queries) {
|
||||||
NSString *methodName = query.methodName;
|
NSString *methodName = query.methodName;
|
||||||
NSDictionary *parameters = query.JSON;
|
NSDictionary *parameters = query.JSON;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
+ (instancetype)get;
|
+ (instancetype)get;
|
||||||
|
|
||||||
- (MPUserEntity *)activeUserForThread;
|
- (MPUserEntity *)activeUserForMainThread;
|
||||||
- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc;
|
- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc;
|
||||||
- (void)setActiveUser:(MPUserEntity *)activeUser;
|
- (void)setActiveUser:(MPUserEntity *)activeUser;
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPUserEntity *)activeUserForThread {
|
- (MPUserEntity *)activeUserForMainThread {
|
||||||
|
|
||||||
return [self activeUserInContext:[MPAppDelegate_Shared managedObjectContextForThreadIfReady]];
|
return [self activeUserInContext:[MPAppDelegate_Shared managedObjectContextForMainThreadIfReady]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc {
|
- (MPUserEntity *)activeUserInContext:(NSManagedObjectContext *)moc {
|
||||||
|
@ -20,12 +20,13 @@ typedef enum {
|
|||||||
|
|
||||||
@interface MPAppDelegate_Shared(Store)<UbiquityStoreManagerDelegate>
|
@interface MPAppDelegate_Shared(Store)<UbiquityStoreManagerDelegate>
|
||||||
|
|
||||||
+ (NSManagedObjectContext *)managedObjectContextForThreadIfReady;
|
+ (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady;
|
||||||
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock;
|
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock;
|
||||||
+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock;
|
+ (BOOL)managedObjectContextPerformBlockAndWait:(void (^)(NSManagedObjectContext *context))mocBlock;
|
||||||
|
|
||||||
- (UbiquityStoreManager *)storeManager;
|
- (UbiquityStoreManager *)storeManager;
|
||||||
|
|
||||||
|
/** @param completion The block to execute after adding the element, executed from the main thread with the new element in the main MOC. */
|
||||||
- (void)addElementNamed:(NSString *)siteName completion:(void (^)(MPElementEntity *element))completion;
|
- (void)addElementNamed:(NSString *)siteName completion:(void (^)(MPElementEntity *element))completion;
|
||||||
- (MPElementEntity *)changeElement:(MPElementEntity *)element inContext:(NSManagedObjectContext *)context toType:(MPElementType)type;
|
- (MPElementEntity *)changeElement:(MPElementEntity *)element inContext:(NSManagedObjectContext *)context toType:(MPElementType)type;
|
||||||
- (MPImportResult)importSites:(NSString *)importedSitesString
|
- (MPImportResult)importSites:(NSString *)importedSitesString
|
||||||
|
@ -39,19 +39,14 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext,
|
|||||||
|
|
||||||
#pragma mark - Core Data setup
|
#pragma mark - Core Data setup
|
||||||
|
|
||||||
+ (NSManagedObjectContext *)managedObjectContextForThreadIfReady {
|
+ (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady {
|
||||||
|
|
||||||
|
NSAssert([[NSThread currentThread] isMainThread], @"Can only access main MOC from the main thread.");
|
||||||
NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady];
|
NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady];
|
||||||
if (!mainManagedObjectContext)
|
if (!mainManagedObjectContext || ![[NSThread currentThread] isMainThread])
|
||||||
return nil;
|
return nil;
|
||||||
if ([[NSThread currentThread] isMainThread])
|
|
||||||
return mainManagedObjectContext;
|
|
||||||
|
|
||||||
NSManagedObjectContext
|
return mainManagedObjectContext;
|
||||||
*threadManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSConfinementConcurrencyType];
|
|
||||||
threadManagedObjectContext.parentContext = mainManagedObjectContext;
|
|
||||||
|
|
||||||
return threadManagedObjectContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock {
|
+ (BOOL)managedObjectContextPerformBlock:(void (^)(NSManagedObjectContext *context))mocBlock {
|
||||||
@ -396,8 +391,8 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
[MPAppDelegate_Shared managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
[MPAppDelegate_Shared managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||||
MPUserEntity *activeUser = [self activeUserInContext:moc];
|
MPUserEntity *activeUser = [self activeUserInContext:context];
|
||||||
assert(activeUser);
|
assert(activeUser);
|
||||||
|
|
||||||
MPElementType type = activeUser.defaultType;
|
MPElementType type = activeUser.defaultType;
|
||||||
@ -406,22 +401,22 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext,
|
|||||||
NSString *typeEntityClassName = [MPAlgorithmDefault classNameOfType:type];
|
NSString *typeEntityClassName = [MPAlgorithmDefault classNameOfType:type];
|
||||||
|
|
||||||
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:typeEntityClassName
|
MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:typeEntityClassName
|
||||||
inManagedObjectContext:moc];
|
inManagedObjectContext:context];
|
||||||
|
|
||||||
element.name = siteName;
|
element.name = siteName;
|
||||||
element.user = activeUser;
|
element.user = activeUser;
|
||||||
element.type = type;
|
element.type = type;
|
||||||
element.lastUsed = [NSDate date];
|
element.lastUsed = [NSDate date];
|
||||||
element.version = MPAlgorithmDefaultVersion;
|
element.version = MPAlgorithmDefaultVersion;
|
||||||
[moc saveToStore];
|
[context saveToStore];
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if (element.objectID.isTemporaryID && ![moc obtainPermanentIDsForObjects:@[ element ] error:&error])
|
if (element.objectID.isTemporaryID && ![context obtainPermanentIDsForObjects:@[ element ] error:&error])
|
||||||
err(@"Failed to obtain a permanent object ID after creating new element: %@", error);
|
err(@"Failed to obtain a permanent object ID after creating new element: %@", error);
|
||||||
|
|
||||||
NSManagedObjectID *elementOID = [element objectID];
|
NSManagedObjectID *elementOID = [element objectID];
|
||||||
dispatch_async( dispatch_get_main_queue(), ^{
|
dispatch_async( dispatch_get_main_queue(), ^{
|
||||||
completion( (MPElementEntity *)[[MPAppDelegate_Shared managedObjectContextForThreadIfReady] objectRegisteredForID:elementOID] );
|
completion( (MPElementEntity *)[[MPAppDelegate_Shared managedObjectContextForMainThreadIfReady] objectRegisteredForID:elementOID] );
|
||||||
} );
|
} );
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@ -689,7 +684,7 @@ PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext,
|
|||||||
|
|
||||||
- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords {
|
- (NSString *)exportSitesShowingPasswords:(BOOL)showPasswords {
|
||||||
|
|
||||||
MPUserEntity *activeUser = [self activeUserForThread];
|
MPUserEntity *activeUser = [self activeUserForMainThread];
|
||||||
inf(@"Exporting sites, %@, for: %@", showPasswords? @"showing passwords": @"omitting passwords", activeUser.userID);
|
inf(@"Exporting sites, %@, for: %@", showPasswords? @"showing passwords": @"omitting passwords", activeUser.userID);
|
||||||
|
|
||||||
// Header.
|
// Header.
|
||||||
|
@ -66,8 +66,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
[[self.usersItem submenu] removeItem:obj];
|
[[self.usersItem submenu] removeItem:obj];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
NSManagedObjectContext *moc = [MPMacAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPMacAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
if (!moc) {
|
if (!context) {
|
||||||
self.createUserItem.title = @"New User (Not ready)";
|
self.createUserItem.title = @"New User (Not ready)";
|
||||||
self.createUserItem.enabled = NO;
|
self.createUserItem.enabled = NO;
|
||||||
self.createUserItem.toolTip = @"Please wait until the app is fully loaded.";
|
self.createUserItem.toolTip = @"Please wait until the app is fully loaded.";
|
||||||
@ -83,7 +83,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPUserEntity class] )];
|
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPUserEntity class] )];
|
||||||
fetchRequest.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO] ];
|
fetchRequest.sortDescriptors = @[ [NSSortDescriptor sortDescriptorWithKey:@"lastUsed" ascending:NO] ];
|
||||||
NSArray *users = [moc executeFetchRequest:fetchRequest error:&error];
|
NSArray *users = [context executeFetchRequest:fetchRequest error:&error];
|
||||||
if (!users)
|
if (!users)
|
||||||
err(@"Failed to load users: %@", error);
|
err(@"Failed to load users: %@", error);
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
@"Then give iCloud some time to sync the new user to your Mac.";
|
@"Then give iCloud some time to sync the new user to your Mac.";
|
||||||
}
|
}
|
||||||
|
|
||||||
MPUserEntity *activeUser = self.activeUserForThread;
|
MPUserEntity *activeUser = [self activeUserInContext:context];
|
||||||
for (MPUserEntity *user in users) {
|
for (MPUserEntity *user in users) {
|
||||||
NSMenuItem *userItem = [[NSMenuItem alloc] initWithTitle:user.name action:@selector(selectUser:) keyEquivalent:@""];
|
NSMenuItem *userItem = [[NSMenuItem alloc] initWithTitle:user.name action:@selector(selectUser:) keyEquivalent:@""];
|
||||||
[userItem setTarget:self];
|
[userItem setTarget:self];
|
||||||
@ -113,8 +113,8 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
[self signOutAnimated:NO];
|
[self signOutAnimated:NO];
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
NSManagedObjectContext *moc = [MPMacAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPMacAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
self.activeUser = (MPUserEntity *)[moc existingObjectWithID:[item representedObject] error:&error];
|
self.activeUser = (MPUserEntity *)[context existingObjectWithID:[item representedObject] error:&error];
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
err(@"While looking up selected user: %@", error);
|
err(@"While looking up selected user: %@", error);
|
||||||
@ -261,7 +261,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPCheckConfigNotification object:nil queue:nil usingBlock:
|
[[NSNotificationCenter defaultCenter] addObserverForName:MPCheckConfigNotification object:nil queue:nil usingBlock:
|
||||||
^(NSNotification *note) {
|
^(NSNotification *note) {
|
||||||
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
|
self.rememberPasswordItem.state = [[MPConfig get].rememberLogin boolValue]? NSOnState: NSOffState;
|
||||||
self.savePasswordItem.state = [[MPMacAppDelegate get] activeUserForThread].saveKey? NSOnState: NSOffState;
|
self.savePasswordItem.state = [[MPMacAppDelegate get] activeUserForMainThread].saveKey? NSOnState: NSOffState;
|
||||||
self.dialogStyleRegular.state = ![[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState;
|
self.dialogStyleRegular.state = ![[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState;
|
||||||
self.dialogStyleHUD.state = [[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState;
|
self.dialogStyleHUD.state = [[MPMacConfig get].dialogStyleHUD boolValue]? NSOnState: NSOffState;
|
||||||
|
|
||||||
@ -283,13 +283,13 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
OSStatus status = InstallApplicationEventHandler(NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ),
|
OSStatus status = InstallApplicationEventHandler(NewEventHandlerUPP( MPHotKeyHander ), GetEventTypeCount( hotKeyEvents ),
|
||||||
hotKeyEvents, (__bridge void *)self, NULL);
|
hotKeyEvents, (__bridge void *)self, NULL);
|
||||||
if (status != noErr)
|
if (status != noErr)
|
||||||
err(@"Error installing application event handler: %d", 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 );
|
||||||
if (status != noErr)
|
if (status != noErr)
|
||||||
err(@"Error registering 'show' hotkey: %d", status);
|
err(@"Error registering 'show' hotkey: %i", (int)status);
|
||||||
status = RegisterEventHotKey( 35 /* p */, controlKey + optionKey + cmdKey, MPLockHotKey, GetApplicationEventTarget(), 0, &hotKeyRef );
|
status = RegisterEventHotKey( 35 /* p */, controlKey + optionKey + cmdKey, MPLockHotKey, GetApplicationEventTarget(), 0, &hotKeyRef );
|
||||||
if (status != noErr)
|
if (status != noErr)
|
||||||
err(@"Error registering 'lock' hotkey: %d", status);
|
err(@"Error registering 'lock' hotkey: %i", (int)status);
|
||||||
|
|
||||||
// Initial display.
|
// Initial display.
|
||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
@ -301,11 +301,9 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
|
|
||||||
BOOL reopenPasswordWindow = [self.passwordWindow.window isVisible];
|
BOOL reopenPasswordWindow = [self.passwordWindow.window isVisible];
|
||||||
|
|
||||||
if (![[self activeUserForThread].objectID isEqual:activeUser.objectID]) {
|
[self.passwordWindow close];
|
||||||
[self.passwordWindow close];
|
self.passwordWindow = nil;
|
||||||
self.passwordWindow = nil;
|
[super setActiveUser:activeUser];
|
||||||
[super setActiveUser:activeUser];
|
|
||||||
}
|
|
||||||
|
|
||||||
self.usersItem.state = NSMixedState;
|
self.usersItem.state = NSMixedState;
|
||||||
[[[self.usersItem submenu] itemArray] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
[[[self.usersItem submenu] itemArray] enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
|
||||||
@ -325,7 +323,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
|
|
||||||
- (void)updateMenuItems {
|
- (void)updateMenuItems {
|
||||||
|
|
||||||
MPUserEntity *activeUser = [self activeUserForThread];
|
MPUserEntity *activeUser = [self activeUserForMainThread];
|
||||||
// if (!(self.showItem.enabled = ![self.passwordWindow.window isVisible])) {
|
// if (!(self.showItem.enabled = ![self.passwordWindow.window isVisible])) {
|
||||||
// self.showItem.title = @"Show (Showing)";
|
// self.showItem.title = @"Show (Showing)";
|
||||||
// self.showItem.toolTip = @"Master Password is already showing.";
|
// self.showItem.toolTip = @"Master Password is already showing.";
|
||||||
@ -390,7 +388,7 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
[NSApp activateIgnoringOtherApps:YES];
|
[NSApp activateIgnoringOtherApps:YES];
|
||||||
|
|
||||||
// If no user, can't activate.
|
// If no user, can't activate.
|
||||||
if (![self activeUserForThread]) {
|
if (![self activeUserForMainThread]) {
|
||||||
[[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil
|
[[NSAlert alertWithMessageText:@"No User Selected" defaultButton:[PearlStrings get].commonButtonOkay alternateButton:nil
|
||||||
otherButton:nil informativeTextWithFormat:
|
otherButton:nil informativeTextWithFormat:
|
||||||
@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock."]
|
@"Begin by selecting or creating your user from the status menu (●●●|) next to the clock."]
|
||||||
@ -444,17 +442,17 @@ static OSStatus MPHotKeyHander(EventHandlerCallRef nextHandler, EventRef theEven
|
|||||||
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
|
||||||
// Save changes in the application's managed object context before the application terminates.
|
// Save changes in the application's managed object context before the application terminates.
|
||||||
|
|
||||||
NSManagedObjectContext *moc = [MPMacAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPMacAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
if (!moc)
|
if (!context)
|
||||||
return NSTerminateNow;
|
return NSTerminateNow;
|
||||||
|
|
||||||
if (![moc commitEditing])
|
if (![context commitEditing])
|
||||||
return NSTerminateCancel;
|
return NSTerminateCancel;
|
||||||
|
|
||||||
if (![moc hasChanges])
|
if (![context hasChanges])
|
||||||
return NSTerminateNow;
|
return NSTerminateNow;
|
||||||
|
|
||||||
[moc saveToStore];
|
[context saveToStore];
|
||||||
return NSTerminateNow;
|
return NSTerminateNow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
[self setContent:@""];
|
[self setContent:@""];
|
||||||
[self.tipField setStringValue:@""];
|
[self.tipField setStringValue:@""];
|
||||||
|
|
||||||
[self.userLabel setStringValue:PearlString( @"%@'s password for:", [[MPMacAppDelegate get] activeUserForThread].name )];
|
[self.userLabel setStringValue:PearlString( @"%@'s password for:", [[MPMacAppDelegate get] activeUserForMainThread].name )];
|
||||||
[[MPMacAppDelegate get] addObserverBlock:^(NSString *keyPath, id object, NSDictionary *change, void *context) {
|
[[MPMacAppDelegate get] addObserverBlock:^(NSString *keyPath, id object, NSDictionary *change, void *context) {
|
||||||
// [MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
// [MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
||||||
// if (![MPAlgorithmDefault migrateUser:[[MPMacAppDelegate get] activeUserInContext:moc]])
|
// if (![MPAlgorithmDefault migrateUser:[[MPMacAppDelegate get] activeUserInContext:moc]])
|
||||||
@ -106,7 +106,7 @@
|
|||||||
|
|
||||||
- (BOOL)ensureStoreLoaded {
|
- (BOOL)ensureStoreLoaded {
|
||||||
|
|
||||||
if ([MPMacAppDelegate managedObjectContextForThreadIfReady]) {
|
if ([MPMacAppDelegate managedObjectContextForMainThreadIfReady]) {
|
||||||
// Store loaded.
|
// Store loaded.
|
||||||
if (self.loadingDataAlert.window)
|
if (self.loadingDataAlert.window)
|
||||||
[NSApp endSheet:self.loadingDataAlert.window];
|
[NSApp endSheet:self.loadingDataAlert.window];
|
||||||
@ -197,12 +197,12 @@
|
|||||||
runModal];
|
runModal];
|
||||||
|
|
||||||
if (returnCode_ == NSAlertDefaultReturn) {
|
if (returnCode_ == NSAlertDefaultReturn) {
|
||||||
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *moc) {
|
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||||
MPUserEntity *activeUser = [[MPMacAppDelegate get] activeUserInContext:moc];
|
MPUserEntity *activeUser = [[MPMacAppDelegate get] activeUserInContext:context];
|
||||||
activeUser.keyID = nil;
|
activeUser.keyID = nil;
|
||||||
[[MPMacAppDelegate get] forgetSavedKeyFor:activeUser];
|
[[MPMacAppDelegate get] forgetSavedKeyFor:activeUser];
|
||||||
[[MPMacAppDelegate get] signOutAnimated:YES];
|
[[MPMacAppDelegate get] signOutAnimated:YES];
|
||||||
[moc saveToStore];
|
[context saveToStore];
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -315,7 +315,7 @@
|
|||||||
if (notification.object == self.typeField) {
|
if (notification.object == self.typeField) {
|
||||||
if ([self.typeField indexOfSelectedItem] < 0)
|
if ([self.typeField indexOfSelectedItem] < 0)
|
||||||
return;
|
return;
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
MPElementType selectedType = [self selectedType];
|
MPElementType selectedType = [self selectedType];
|
||||||
if (!activeElement || activeElement.type == selectedType || !(selectedType & MPElementTypeClassGenerated))
|
if (!activeElement || activeElement.type == selectedType || !(selectedType & MPElementTypeClassGenerated))
|
||||||
return;
|
return;
|
||||||
@ -421,9 +421,9 @@
|
|||||||
self.siteFieldPreventCompletion = NO;
|
self.siteFieldPreventCompletion = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPElementEntity *)activeElementForThread {
|
- (MPElementEntity *)activeElementForMainThread {
|
||||||
|
|
||||||
return [self activeElementInContext:[MPMacAppDelegate managedObjectContextForThreadIfReady]];
|
return [self activeElementInContext:[MPMacAppDelegate managedObjectContextForMainThreadIfReady]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPElementEntity *)activeElementInContext:(NSManagedObjectContext *)moc {
|
- (MPElementEntity *)activeElementInContext:(NSManagedObjectContext *)moc {
|
||||||
@ -453,9 +453,9 @@
|
|||||||
|
|
||||||
NSString *siteName = [self.siteField stringValue];
|
NSString *siteName = [self.siteField stringValue];
|
||||||
[self.progressView startAnimation:nil];
|
[self.progressView startAnimation:nil];
|
||||||
[self.backgroundQueue addOperationWithBlock:^{
|
[MPMacAppDelegate managedObjectContextPerformBlock:^(NSManagedObjectContext *context) {
|
||||||
BOOL actionHandled = NO;
|
BOOL actionHandled = NO;
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementInContext:context];
|
||||||
NSString *content = [activeElement.content description];
|
NSString *content = [activeElement.content description];
|
||||||
NSString *typeName = [activeElement typeShortName];
|
NSString *typeName = [activeElement typeShortName];
|
||||||
if (!content)
|
if (!content)
|
||||||
|
@ -28,15 +28,15 @@
|
|||||||
NSAssert([[NSThread currentThread] isMainThread], @"The fetchedResultsController must be accessed from the main thread.");
|
NSAssert([[NSThread currentThread] isMainThread], @"The fetchedResultsController must be accessed from the main thread.");
|
||||||
|
|
||||||
if (!_fetchedResultsControllerByLastUsed) {
|
if (!_fetchedResultsControllerByLastUsed) {
|
||||||
NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
if (!mainContext)
|
if (!context)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
||||||
fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO] ];
|
fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(lastUsed) ) ascending:NO] ];
|
||||||
[self configureFetchRequest:fetchRequest];
|
[self configureFetchRequest:fetchRequest];
|
||||||
_fetchedResultsControllerByLastUsed = [[NSFetchedResultsController alloc]
|
_fetchedResultsControllerByLastUsed = [[NSFetchedResultsController alloc]
|
||||||
initWithFetchRequest:fetchRequest managedObjectContext:mainContext sectionNameKeyPath:nil cacheName:nil];
|
initWithFetchRequest:fetchRequest managedObjectContext:context sectionNameKeyPath:nil cacheName:nil];
|
||||||
_fetchedResultsControllerByLastUsed.delegate = self;
|
_fetchedResultsControllerByLastUsed.delegate = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,15 +48,15 @@
|
|||||||
NSAssert([[NSThread currentThread] isMainThread], @"The fetchedResultsController must be accessed from the main thread.");
|
NSAssert([[NSThread currentThread] isMainThread], @"The fetchedResultsController must be accessed from the main thread.");
|
||||||
|
|
||||||
if (!_fetchedResultsControllerByUses) {
|
if (!_fetchedResultsControllerByUses) {
|
||||||
NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
if (!mainContext)
|
if (!context)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:NSStringFromClass( [MPElementEntity class] )];
|
||||||
fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(uses_) ) ascending:NO] ];
|
fetchRequest.sortDescriptors = @[ [[NSSortDescriptor alloc] initWithKey:NSStringFromSelector( @selector(uses_) ) ascending:NO] ];
|
||||||
[self configureFetchRequest:fetchRequest];
|
[self configureFetchRequest:fetchRequest];
|
||||||
_fetchedResultsControllerByUses = [[NSFetchedResultsController alloc]
|
_fetchedResultsControllerByUses = [[NSFetchedResultsController alloc]
|
||||||
initWithFetchRequest:fetchRequest managedObjectContext:mainContext sectionNameKeyPath:nil cacheName:nil];
|
initWithFetchRequest:fetchRequest managedObjectContext:context sectionNameKeyPath:nil cacheName:nil];
|
||||||
_fetchedResultsControllerByUses.delegate = self;
|
_fetchedResultsControllerByUses.delegate = self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
- (void)updateData {
|
- (void)updateData {
|
||||||
|
|
||||||
MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForThread];
|
MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserInContext:self.fetchedResultsControllerByLastUsed.managedObjectContext];
|
||||||
if (!activeUser) {
|
if (!activeUser) {
|
||||||
_fetchedResultsControllerByLastUsed = nil;
|
_fetchedResultsControllerByLastUsed = nil;
|
||||||
_fetchedResultsControllerByUses = nil;
|
_fetchedResultsControllerByUses = nil;
|
||||||
|
@ -193,7 +193,7 @@
|
|||||||
NSString *query = [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
NSString *query = [self.searchDisplayController.searchBar.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
|
||||||
cell.textLabel.text = query;
|
cell.textLabel.text = query;
|
||||||
cell.detailTextLabel.text = PearlString( @"New site: %@",
|
cell.detailTextLabel.text = PearlString( @"New site: %@",
|
||||||
[MPAlgorithmDefault shortNameOfType:[[[MPiOSAppDelegate get] activeUserForThread] defaultType]] );
|
[MPAlgorithmDefault shortNameOfType:[[[MPiOSAppDelegate get] activeUserForMainThread] defaultType]] );
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
|
@ -83,7 +83,7 @@
|
|||||||
}];
|
}];
|
||||||
[[NSNotificationCenter defaultCenter] addObserverForName:MPElementUpdatedNotification object:nil queue:nil usingBlock:
|
[[NSNotificationCenter defaultCenter] addObserverForName:MPElementUpdatedNotification object:nil queue:nil usingBlock:
|
||||||
^void(NSNotification *note) {
|
^void(NSNotification *note) {
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (activeElement.type & MPElementTypeClassStored && ![[activeElement.content description] length])
|
if (activeElement.type & MPElementTypeClassStored && ![[activeElement.content description] length])
|
||||||
[self showToolTip:@"Tap to set a password." withIcon:self.toolTipEditIcon];
|
[self showToolTip:@"Tap to set a password." withIcon:self.toolTipEditIcon];
|
||||||
if (activeElement.requiresExplicitMigration)
|
if (activeElement.requiresExplicitMigration)
|
||||||
@ -109,7 +109,7 @@
|
|||||||
}];
|
}];
|
||||||
[[NSNotificationCenter defaultCenter] addObserverForName:USMStoreDidChangeNotification object:nil queue:nil usingBlock:
|
[[NSNotificationCenter defaultCenter] addObserverForName:USMStoreDidChangeNotification object:nil queue:nil usingBlock:
|
||||||
^(NSNotification *note) {
|
^(NSNotification *note) {
|
||||||
if (!self.activeElementForThread)
|
if (!self.activeElementForMainThread)
|
||||||
[self didSelectElement:nil];
|
[self didSelectElement:nil];
|
||||||
}];
|
}];
|
||||||
|
|
||||||
@ -118,8 +118,8 @@
|
|||||||
|
|
||||||
- (void)viewWillAppear:(BOOL)animated {
|
- (void)viewWillAppear:(BOOL)animated {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (activeElement.user != [[MPiOSAppDelegate get] activeUserForThread])
|
if (activeElement.user != [[MPiOSAppDelegate get] activeUserForMainThread])
|
||||||
_activeElementOID = nil;
|
_activeElementOID = nil;
|
||||||
|
|
||||||
self.searchDisplayController.searchBar.text = nil;
|
self.searchDisplayController.searchBar.text = nil;
|
||||||
@ -197,7 +197,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
[self setHelpChapter:activeElement? @"2": @"1"];
|
[self setHelpChapter:activeElement? @"2": @"1"];
|
||||||
[self updateHelpHiddenAnimated:NO];
|
[self updateHelpHiddenAnimated:NO];
|
||||||
|
|
||||||
@ -358,7 +358,7 @@
|
|||||||
|
|
||||||
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:
|
NSString *error = [self.helpView stringByEvaluatingJavaScriptFromString:
|
||||||
PearlString( @"setClass('%@');", activeElement.typeClassName )];
|
PearlString( @"setClass('%@');", activeElement.typeClassName )];
|
||||||
if (error.length)
|
if (error.length)
|
||||||
@ -464,7 +464,7 @@
|
|||||||
|
|
||||||
- (IBAction)copyContent {
|
- (IBAction)copyContent {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
id content = activeElement.content;
|
id content = activeElement.content;
|
||||||
if (!content)
|
if (!content)
|
||||||
// Nothing to copy.
|
// Nothing to copy.
|
||||||
@ -484,7 +484,7 @@
|
|||||||
|
|
||||||
- (IBAction)copyLoginName:(UITapGestureRecognizer *)sender {
|
- (IBAction)copyLoginName:(UITapGestureRecognizer *)sender {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (!activeElement.loginName)
|
if (!activeElement.loginName)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -531,7 +531,7 @@
|
|||||||
if (sender.state != UIGestureRecognizerStateBegan)
|
if (sender.state != UIGestureRecognizerStateBegan)
|
||||||
// Only fire when the gesture was first detected.
|
// Only fire when the gesture was first detected.
|
||||||
return;
|
return;
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (![activeElement isKindOfClass:[MPElementGeneratedEntity class]]) {
|
if (![activeElement isKindOfClass:[MPElementGeneratedEntity class]]) {
|
||||||
// Not of a type that supports a password counter.
|
// Not of a type that supports a password counter.
|
||||||
err(@"Cannot reset password counter: Element is not generated: %@", activeElement.name);
|
err(@"Cannot reset password counter: Element is not generated: %@", activeElement.name);
|
||||||
@ -563,7 +563,7 @@
|
|||||||
// Only fire when the gesture was first detected.
|
// Only fire when the gesture was first detected.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (!activeElement)
|
if (!activeElement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -621,9 +621,9 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPElementEntity *)activeElementForThread {
|
- (MPElementEntity *)activeElementForMainThread {
|
||||||
|
|
||||||
return [self activeElementInContext:[MPiOSAppDelegate managedObjectContextForThreadIfReady]];
|
return [self activeElementInContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPElementEntity *)activeElementInContext:(NSManagedObjectContext *)moc {
|
- (MPElementEntity *)activeElementInContext:(NSManagedObjectContext *)moc {
|
||||||
@ -641,7 +641,7 @@
|
|||||||
|
|
||||||
- (IBAction)editPassword {
|
- (IBAction)editPassword {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (!(activeElement.type & MPElementTypeClassStored)) {
|
if (!(activeElement.type & MPElementTypeClassStored)) {
|
||||||
// Not of a type that supports editing the content.
|
// Not of a type that supports editing the content.
|
||||||
err(@"Cannot edit content: Element is not stored: %@", activeElement.name);
|
err(@"Cannot edit content: Element is not stored: %@", activeElement.name);
|
||||||
@ -659,7 +659,7 @@
|
|||||||
|
|
||||||
- (IBAction)upgradePassword {
|
- (IBAction)upgradePassword {
|
||||||
|
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (!activeElement)
|
if (!activeElement)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -779,7 +779,7 @@
|
|||||||
|
|
||||||
- (MPElementEntity *)selectedElement {
|
- (MPElementEntity *)selectedElement {
|
||||||
|
|
||||||
return [self activeElementForThread];
|
return [self activeElementForMainThread];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)didSelectType:(MPElementType)type {
|
- (void)didSelectType:(MPElementType)type {
|
||||||
@ -855,7 +855,7 @@
|
|||||||
|
|
||||||
if (textField == self.contentField) {
|
if (textField == self.contentField) {
|
||||||
self.contentField.enabled = NO;
|
self.contentField.enabled = NO;
|
||||||
MPElementEntity *activeElement = [self activeElementForThread];
|
MPElementEntity *activeElement = [self activeElementForMainThread];
|
||||||
if (![activeElement isKindOfClass:[MPElementStoredEntity class]]) {
|
if (![activeElement isKindOfClass:[MPElementStoredEntity class]]) {
|
||||||
// Not of a type whose content can be edited.
|
// Not of a type whose content can be edited.
|
||||||
err(@"Cannot update element content: Element is not stored: %@", activeElement.name);
|
err(@"Cannot update element content: Element is not stored: %@", activeElement.name);
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
} options:0];
|
} options:0];
|
||||||
avatar.selected = (a == [[MPiOSAppDelegate get] activeUserForThread].avatar);
|
avatar.selected = (a == [[MPiOSAppDelegate get] activeUserForMainThread].avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
@ -70,7 +70,7 @@
|
|||||||
}
|
}
|
||||||
} recurse:NO];
|
} recurse:NO];
|
||||||
|
|
||||||
MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForThread];
|
MPUserEntity *activeUser = [[MPiOSAppDelegate get] activeUserForMainThread];
|
||||||
self.savePasswordSwitch.on = activeUser.saveKey;
|
self.savePasswordSwitch.on = activeUser.saveKey;
|
||||||
self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:activeUser.defaultType];
|
self.defaultTypeLabel.text = [[MPiOSAppDelegate get].key.algorithm shortNameOfType:activeUser.defaultType];
|
||||||
|
|
||||||
@ -154,7 +154,7 @@
|
|||||||
|
|
||||||
- (MPElementType)selectedType {
|
- (MPElementType)selectedType {
|
||||||
|
|
||||||
return [[MPiOSAppDelegate get] activeUserForThread].defaultType;
|
return [[MPiOSAppDelegate get] activeUserForMainThread].defaultType;
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - IBActions
|
#pragma mark - IBActions
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
MPElementType selectedType = selectedElement? selectedElement.type: [self.delegate selectedType];
|
MPElementType selectedType = selectedElement? selectedElement.type: [self.delegate selectedType];
|
||||||
cell.selected = (selectedType == cellType);
|
cell.selected = (selectedType == cellType);
|
||||||
|
|
||||||
if (cellType != NSNotFound && cellType & MPElementTypeClassGenerated) {
|
if (cellType != (MPElementType)NSNotFound && cellType & MPElementTypeClassGenerated) {
|
||||||
[(UITextField *)[cell viewWithTag:2] setText:@"..."];
|
[(UITextField *)[cell viewWithTag:2] setText:@"..."];
|
||||||
|
|
||||||
NSString *name = selectedElement.name;
|
NSString *name = selectedElement.name;
|
||||||
@ -99,7 +99,7 @@
|
|||||||
assert(self.navigationController.topViewController == self);
|
assert(self.navigationController.topViewController == self);
|
||||||
|
|
||||||
MPElementType type = [self typeAtIndexPath:indexPath];
|
MPElementType type = [self typeAtIndexPath:indexPath];
|
||||||
if (type == NSNotFound)
|
if (type == (MPElementType)NSNotFound)
|
||||||
// Selected a non-type row.
|
// Selected a non-type row.
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -369,11 +369,11 @@
|
|||||||
|
|
||||||
NSAssert([[NSThread currentThread] isMainThread], @"User selection should only be toggled from the main thread.");
|
NSAssert([[NSThread currentThread] isMainThread], @"User selection should only be toggled from the main thread.");
|
||||||
|
|
||||||
NSManagedObjectContext *mainContext = [MPiOSAppDelegate managedObjectContextForThreadIfReady];
|
NSManagedObjectContext *context = [MPiOSAppDelegate managedObjectContextForMainThreadIfReady];
|
||||||
MPUserEntity *selectedUser = [self selectedUserInContext:mainContext];
|
MPUserEntity *selectedUser = [self selectedUserInContext:context];
|
||||||
if (!selectedUser)
|
if (!selectedUser)
|
||||||
[self.passwordField resignFirstResponder];
|
[self.passwordField resignFirstResponder];
|
||||||
else if ([[MPiOSAppDelegate get] signInAsUser:selectedUser saveInContext:mainContext usingMasterPassword:nil]) {
|
else if ([[MPiOSAppDelegate get] signInAsUser:selectedUser saveInContext:context usingMasterPassword:nil]) {
|
||||||
[self performSegueWithIdentifier:@"MP_Unlock" sender:self];
|
[self performSegueWithIdentifier:@"MP_Unlock" sender:self];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -556,7 +556,7 @@
|
|||||||
UIButton *targetedAvatar = selectedAvatar;
|
UIButton *targetedAvatar = selectedAvatar;
|
||||||
if (!targetedAvatar) {
|
if (!targetedAvatar) {
|
||||||
targetedAvatar = [self findTargetedAvatar];
|
targetedAvatar = [self findTargetedAvatar];
|
||||||
targetedUser = [self userForAvatar:targetedAvatar inContext:[MPiOSAppDelegate managedObjectContextForThreadIfReady]];
|
targetedUser = [self userForAvatar:targetedAvatar inContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady]];
|
||||||
}
|
}
|
||||||
|
|
||||||
[self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
[self.avatarsView enumerateSubviews:^(UIView *subview, BOOL *stop, BOOL *recurse) {
|
||||||
@ -1140,7 +1140,7 @@
|
|||||||
|
|
||||||
- (MPUserEntity *)selectedUserForThread {
|
- (MPUserEntity *)selectedUserForThread {
|
||||||
|
|
||||||
return [self selectedUserInContext:[MPiOSAppDelegate managedObjectContextForThreadIfReady]];
|
return [self selectedUserInContext:[MPiOSAppDelegate managedObjectContextForMainThreadIfReady]];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (MPUserEntity *)selectedUserInContext:(NSManagedObjectContext *)moc {
|
- (MPUserEntity *)selectedUserInContext:(NSManagedObjectContext *)moc {
|
||||||
|
@ -491,7 +491,7 @@
|
|||||||
|
|
||||||
- (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController {
|
- (void)openFeedbackWithLogs:(BOOL)logs forVC:(UIViewController *)viewController {
|
||||||
|
|
||||||
NSString *userName = [[MPiOSAppDelegate get] activeUserForThread].name;
|
NSString *userName = [[MPiOSAppDelegate get] activeUserForMainThread].name;
|
||||||
PearlLogLevel logLevel = PearlLogLevelInfo;
|
PearlLogLevel logLevel = PearlLogLevelInfo;
|
||||||
if (logs && ([[MPiOSConfig get].sendInfo boolValue] || [[MPiOSConfig get].traceMode boolValue]))
|
if (logs && ([[MPiOSConfig get].sendInfo boolValue] || [[MPiOSConfig get].traceMode boolValue]))
|
||||||
logLevel = PearlLogLevelDebug;
|
logLevel = PearlLogLevelDebug;
|
||||||
@ -566,7 +566,7 @@
|
|||||||
@"--\n"
|
@"--\n"
|
||||||
@"%@\n"
|
@"%@\n"
|
||||||
@"Master Password %@, build %@",
|
@"Master Password %@, build %@",
|
||||||
[self activeUserForThread].name,
|
[self activeUserForMainThread].name,
|
||||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||||
[PearlInfoPlist get].CFBundleVersion );
|
[PearlInfoPlist get].CFBundleVersion );
|
||||||
else
|
else
|
||||||
@ -574,7 +574,7 @@
|
|||||||
@"--\n"
|
@"--\n"
|
||||||
@"%@\n"
|
@"%@\n"
|
||||||
@"Master Password %@, build %@",
|
@"Master Password %@, build %@",
|
||||||
[self activeUserForThread].name,
|
[self activeUserForMainThread].name,
|
||||||
[PearlInfoPlist get].CFBundleShortVersionString,
|
[PearlInfoPlist get].CFBundleShortVersionString,
|
||||||
[PearlInfoPlist get].CFBundleVersion );
|
[PearlInfoPlist get].CFBundleVersion );
|
||||||
|
|
||||||
@ -584,7 +584,7 @@
|
|||||||
[PearlEMail sendEMailTo:nil subject:@"Master Password Export" body:message
|
[PearlEMail sendEMailTo:nil subject:@"Master Password Export" body:message
|
||||||
attachments:[[PearlEMailAttachment alloc] initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding]
|
attachments:[[PearlEMailAttachment alloc] initWithContent:[exportedSites dataUsingEncoding:NSUTF8StringEncoding]
|
||||||
mimeType:@"text/plain" fileName:
|
mimeType:@"text/plain" fileName:
|
||||||
PearlString( @"%@ (%@).mpsites", [self activeUserForThread].name,
|
PearlString( @"%@ (%@).mpsites", [self activeUserForMainThread].name,
|
||||||
[exportDateFormatter stringFromDate:[NSDate date]] )],
|
[exportDateFormatter stringFromDate:[NSDate date]] )],
|
||||||
nil];
|
nil];
|
||||||
}
|
}
|
||||||
|
@ -230,7 +230,6 @@
|
|||||||
DABD3C201711E2DC00CF925C /* MPUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DABD3BEF1711E2DC00CF925C /* MPUnlockViewController.m */; };
|
DABD3C201711E2DC00CF925C /* MPUnlockViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DABD3BEF1711E2DC00CF925C /* MPUnlockViewController.m */; };
|
||||||
DABD3C211711E2DC00CF925C /* MPiOSConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DABD3BF11711E2DC00CF925C /* MPiOSConfig.m */; };
|
DABD3C211711E2DC00CF925C /* MPiOSConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = DABD3BF11711E2DC00CF925C /* MPiOSConfig.m */; };
|
||||||
DABD3C221711E2DC00CF925C /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF21711E2DC00CF925C /* MainStoryboard_iPhone.storyboard */; };
|
DABD3C221711E2DC00CF925C /* MainStoryboard_iPhone.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF21711E2DC00CF925C /* MainStoryboard_iPhone.storyboard */; };
|
||||||
DABD3C231711E2DC00CF925C /* MasterPassword-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF31711E2DC00CF925C /* MasterPassword-Info.plist */; };
|
|
||||||
DABD3C241711E2DC00CF925C /* MasterPassword.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF81711E2DC00CF925C /* MasterPassword.entitlements */; };
|
DABD3C241711E2DC00CF925C /* MasterPassword.entitlements in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF81711E2DC00CF925C /* MasterPassword.entitlements */; };
|
||||||
DABD3C251711E2DC00CF925C /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF91711E2DC00CF925C /* Settings.bundle */; };
|
DABD3C251711E2DC00CF925C /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BF91711E2DC00CF925C /* Settings.bundle */; };
|
||||||
DABD3C261711E2DC00CF925C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BFA1711E2DC00CF925C /* InfoPlist.strings */; };
|
DABD3C261711E2DC00CF925C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = DABD3BFA1711E2DC00CF925C /* InfoPlist.strings */; };
|
||||||
@ -3258,7 +3257,7 @@
|
|||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
CLASSPREFIX = MP;
|
CLASSPREFIX = MP;
|
||||||
LastUpgradeCheck = 0460;
|
LastUpgradeCheck = 0500;
|
||||||
ORGANIZATIONNAME = Lyndir;
|
ORGANIZATIONNAME = Lyndir;
|
||||||
};
|
};
|
||||||
buildConfigurationList = DA5BFA3E147E415C00F98B1E /* Build configuration list for PBXProject "MasterPassword-iOS" */;
|
buildConfigurationList = DA5BFA3E147E415C00F98B1E /* Build configuration list for PBXProject "MasterPassword-iOS" */;
|
||||||
@ -3517,7 +3516,6 @@
|
|||||||
DABD3B9E1711E29800CF925C /* social-twitter@2x.png in Resources */,
|
DABD3B9E1711E29800CF925C /* social-twitter@2x.png in Resources */,
|
||||||
DABD3C191711E2DC00CF925C /* MPElementListCellView.xib in Resources */,
|
DABD3C191711E2DC00CF925C /* MPElementListCellView.xib in Resources */,
|
||||||
DABD3C221711E2DC00CF925C /* MainStoryboard_iPhone.storyboard in Resources */,
|
DABD3C221711E2DC00CF925C /* MainStoryboard_iPhone.storyboard in Resources */,
|
||||||
DABD3C231711E2DC00CF925C /* MasterPassword-Info.plist in Resources */,
|
|
||||||
DABD3C241711E2DC00CF925C /* MasterPassword.entitlements in Resources */,
|
DABD3C241711E2DC00CF925C /* MasterPassword.entitlements in Resources */,
|
||||||
DABD3C251711E2DC00CF925C /* Settings.bundle in Resources */,
|
DABD3C251711E2DC00CF925C /* Settings.bundle in Resources */,
|
||||||
DABD3C261711E2DC00CF925C /* InfoPlist.strings in Resources */,
|
DABD3C261711E2DC00CF925C /* InfoPlist.strings in Resources */,
|
||||||
@ -3857,7 +3855,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MasterPassword.app/MasterPassword";
|
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MasterPassword.app/MasterPassword";
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
@ -3887,7 +3884,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MasterPassword.app/MasterPassword";
|
BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/MasterPassword.app/MasterPassword";
|
||||||
CLANG_ENABLE_OBJC_ARC = YES;
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
COPY_PHASE_STRIP = YES;
|
COPY_PHASE_STRIP = YES;
|
||||||
@ -3971,7 +3967,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
@ -4041,7 +4036,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
@ -4166,7 +4160,6 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
|
||||||
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
CLANG_WARN_CXX0X_EXTENSIONS = YES;
|
||||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
CLANG_WARN_EMPTY_BODY = YES;
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
Loading…
Reference in New Issue
Block a user