Fixed wrongfully setting password when password is disabled in editPasswordWindow

Removed some debug logging
This commit is contained in:
michael starke
2013-11-24 00:00:14 +01:00
parent ce61fafc53
commit b0856ad2df
3 changed files with 3 additions and 4 deletions

View File

@@ -511,12 +511,10 @@ typedef NS_ENUM(NSUInteger, MPAlertType) {
} }
- (BOOL)validateMenuItem:(NSMenuItem *)menuItem { - (BOOL)validateMenuItem:(NSMenuItem *)menuItem {
NSLog(@"Valdiate MenuItem:%@", [menuItem title]);
return [self validateUserInterfaceItem:menuItem]; return [self validateUserInterfaceItem:menuItem];
} }
- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem { - (BOOL)validateToolbarItem:(NSToolbarItem *)theItem {
NSLog(@"Valdiate ToolbarItem:%@", [theItem label]);
return [self validateUserInterfaceItem:theItem]; return [self validateUserInterfaceItem:theItem];
} }

View File

@@ -87,7 +87,9 @@
#pragma mark Actions #pragma mark Actions
- (IBAction)save:(id)sender { - (IBAction)save:(id)sender {
[_currentDocument changePassword:[self.passwordTextField stringValue] keyFileURL:[self.keyfilePathControl URL]]; const BOOL hasPassword = ([self.hasPasswordSwitchButton state] == NSOnState);
NSString *password = hasPassword ? [self.passwordTextField stringValue] : nil;
[_currentDocument changePassword:password keyFileURL:[self.keyfilePathControl URL]];
[self dismissSheet:NSRunStoppedResponse]; [self dismissSheet:NSRunStoppedResponse];
if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) { if(self.delegate && [self.delegate respondsToSelector:@selector(didFinishPasswordEditing:)]) {
[self.delegate didFinishPasswordEditing:YES]; [self.delegate didFinishPasswordEditing:YES];

View File

@@ -16,7 +16,6 @@
id target = [NSApp targetForAction:[self action] to:nil from:self]; id target = [NSApp targetForAction:[self action] to:nil from:self];
BOOL isValid = (nil != target); BOOL isValid = (nil != target);
id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self]; id validateTarget = [NSApp targetForAction:@selector(validateToolbarItem:) to:nil from:self];
//NSLog(@"Validation for ToolbarItem:%@", [validateTarget class]);
if(validateTarget) { if(validateTarget) {
isValid &= [validateTarget validateToolbarItem:self]; isValid &= [validateTarget validateToolbarItem:self];
} }