mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 07:02:39 +00:00
Fixed some XCode 7 warning (non-nullable parameters)
Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -148,7 +148,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
|
||||
- (BOOL)application:(NSApplication *)sender openFile:(NSString *)filename {
|
||||
_shouldOpenFile = YES;
|
||||
NSURL *fileURL = [NSURL fileURLWithPath:filename];
|
||||
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES completionHandler:nil];
|
||||
[[NSDocumentController sharedDocumentController] openDocumentWithContentsOfURL:fileURL display:YES completionHandler:^(NSDocument * _Nullable document, BOOL documentWasAlreadyOpen, NSError * _Nullable error){}];
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
@@ -355,17 +355,21 @@ NSString *const _MPTableSecurCellView = @"PasswordCell";
|
||||
- (void)tableView:(NSTableView *)tableView didRemoveRowView:(NSTableRowView *)rowView forRow:(NSInteger)row {
|
||||
/* Rows being removed for data change should be checked here to clear selections */
|
||||
if(row == -1) {
|
||||
[self tableViewSelectionDidChange:nil];
|
||||
[self tableViewSelectionDidChange:[NSNotification notificationWithName:NSTableViewSelectionDidChangeNotification object:tableView]];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)tableViewSelectionDidChange:(NSNotification *)notification {
|
||||
MPDocument *document = [[self windowController] document];
|
||||
if([self.entryTable selectedRow] < 0 || [[_entryTable selectedRowIndexes] count] > 1) {
|
||||
NSTableView *tableView = notification.object;
|
||||
if(tableView != self.entryTable) {
|
||||
return; // Not the right table view
|
||||
}
|
||||
MPDocument *document = self.windowController.document;
|
||||
if(tableView.selectedRow < 0 || tableView.selectedRowIndexes.count > 1) {
|
||||
document.selectedEntry = nil;
|
||||
}
|
||||
else {
|
||||
document.selectedEntry = [self.entryArrayController arrangedObjects][[self.entryTable selectedRow]];
|
||||
document.selectedEntry = self.entryArrayController.arrangedObjects[tableView.selectedRow];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user