Moved multiple instances of entry menu delegate to app delegate

This commit is contained in:
Michael Starke
2019-02-15 10:47:31 +01:00
parent ef7a3085fd
commit 8769f07079
6 changed files with 24 additions and 11 deletions

View File

@@ -55,8 +55,6 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
@private
MPDockTileHelper *_dockTileHelper;
MPUserNotificationCenterDelegate *_userNotificationCenterDelegate;
MPEntryContextMenuDelegate *_entryContextMenuDelegate;
BOOL _shouldOpenFile; // YES if app was started to open a
}
@@ -65,6 +63,8 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
@property (strong, nonatomic) MPPreferencesWindowController *preferencesController;
@property (strong, nonatomic) MPPasswordCreatorViewController *passwordCreatorController;
@property (strong) MPEntryContextMenuDelegate *itemActionMenuDelegate;
@end
@implementation MPAppDelegate
@@ -81,7 +81,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
self = [super init];
if(self) {
_userNotificationCenterDelegate = [[MPUserNotificationCenterDelegate alloc] init];
_entryContextMenuDelegate = [[MPEntryContextMenuDelegate alloc] init];
self.itemActionMenuDelegate = [[MPEntryContextMenuDelegate alloc] init];
/* We know that we do not use the variable after instantiation */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
@@ -130,7 +130,7 @@ NSString *const MPDidChangeStoredKeyFilesSettings = @"com.hicknhack.macpass.MPDi
for(NSMenuItem *item in [MPContextMenuHelper contextMenuItemsWithItems:MPContextMenuFull]) {
[self.itemMenu addItem:item];
}
self.itemMenu.delegate = _entryContextMenuDelegate;
self.itemMenu.delegate = self.itemActionMenuDelegate;
}
#pragma mark -