mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-14 17:32:17 +00:00
Using modern Objective-C
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
|
||||
KPKGroup *targetGroup = targetItem;
|
||||
BOOL validTarget = YES;
|
||||
MPDocument *document = [[[outlineView window] windowController] document];
|
||||
MPDocument *document = outlineView.window.windowController.document;
|
||||
/* Dragging Groups */
|
||||
if(draggedGroup) {
|
||||
self.localDraggedGroup = [document findGroup:draggedGroup.uuid];
|
||||
@@ -177,18 +177,18 @@
|
||||
/* Cleanup old stuff */
|
||||
|
||||
NSArray *types = [pasteboard types];
|
||||
if([types count] > 1 || [types count] == 0) {
|
||||
if(types.count > 1 || types.count == 0) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
NSString *draggedType = [types lastObject];
|
||||
NSString *draggedType = types.lastObject;
|
||||
if([draggedType isEqualToString:KPKGroupUTI]) {
|
||||
// dragging group
|
||||
NSArray *groups = [pasteboard readObjectsForClasses:@[[KPKGroup class]] options:nil];
|
||||
if([groups count] != 1) {
|
||||
if(groups.count != 1) {
|
||||
return NO;
|
||||
}
|
||||
*group = [groups lastObject];
|
||||
*group = groups.lastObject;
|
||||
return YES;
|
||||
}
|
||||
else if([draggedType isEqualToString:KPKEntryUTI]) {
|
||||
@@ -196,7 +196,7 @@
|
||||
if([entries count] != 1) {
|
||||
return NO; // NO entry readable
|
||||
}
|
||||
*entry = [entries lastObject];
|
||||
*entry = entries.lastObject;
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
NSString *extension = [self.document fileNameExtensionForType:uti saveOperation:NSSaveOperation];
|
||||
NSString *title = [NSString stringWithFormat:@"%@ (%@)", description, extension];
|
||||
[menu addItemWithTitle:title action:@selector(setFileType:) keyEquivalent:@""];
|
||||
NSMenuItem *item = [[menu itemArray] lastObject];
|
||||
NSMenuItem *item = menu.itemArray.lastObject;
|
||||
item.target = self;
|
||||
item.representedObject = uti;
|
||||
}
|
||||
@@ -81,7 +81,7 @@
|
||||
}
|
||||
|
||||
- (void)_updateNote {
|
||||
NSString *uti = [[self.fileTypePopupButton selectedItem] representedObject];
|
||||
NSString *uti = self.fileTypePopupButton.selectedItem.representedObject;
|
||||
BOOL showInfoText = (self.document.tree.minimumType == KPKDatabaseTypeXml && [uti isEqualToString:MPLegacyDocumentUTI]);
|
||||
self.infoTextField.hidden = !showInfoText;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user