Removed currently unused AutotypeExecution context.

This commit is contained in:
Michael Starke
2018-12-07 13:43:15 +01:00
parent 713455bacc
commit 9f8617372f
8 changed files with 3 additions and 64 deletions

View File

@@ -135,7 +135,6 @@
4C5A11FE1708DE8700223D8A /* MPPasswordCreatorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5A11FC1708DE8700223D8A /* MPPasswordCreatorViewController.m */; };
4C5EF816218CA03F0003C00E /* MPAutotypeParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5EF815218CA03F0003C00E /* MPAutotypeParser.m */; };
4C5FE9AE17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C5FE9AD17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m */; };
4C61251C21B94BDD00A93924 /* MPAutotypeExecutionContext.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C61251B21B94BDD00A93924 /* MPAutotypeExecutionContext.m */; };
4C61EA0316D2FD0800AC519E /* MPOutlineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C61EA0216D2FD0800AC519E /* MPOutlineViewController.m */; };
4C61EA0516D2FFE200AC519E /* OutlineView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4C61EA0416D2FFE200AC519E /* OutlineView.xib */; };
4C63B8FB17A3154D0091BD72 /* MPContextButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C63B8FA17A3154D0091BD72 /* MPContextButton.m */; };
@@ -550,8 +549,6 @@
4C5F72851FC4351E00929153 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InspectorView.strings; sourceTree = "<group>"; };
4C5FE9AC17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPSelectedAttachmentTableCellView.h; sourceTree = "<group>"; };
4C5FE9AD17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPSelectedAttachmentTableCellView.m; sourceTree = "<group>"; };
4C61251A21B94BDD00A93924 /* MPAutotypeExecutionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPAutotypeExecutionContext.h; sourceTree = "<group>"; };
4C61251B21B94BDD00A93924 /* MPAutotypeExecutionContext.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPAutotypeExecutionContext.m; sourceTree = "<group>"; };
4C61EA0116D2FD0800AC519E /* MPOutlineViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPOutlineViewController.h; sourceTree = "<group>"; };
4C61EA0216D2FD0800AC519E /* MPOutlineViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPOutlineViewController.m; sourceTree = "<group>"; };
4C61EA0416D2FFE200AC519E /* OutlineView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = OutlineView.xib; sourceTree = "<group>"; };
@@ -1512,8 +1509,6 @@
4C90757B18A42E7A00E598DA /* Commands */,
4CEE46DB181C301D006BF1E5 /* MPAutotypeDaemon.h */,
4CEE46DC181C301D006BF1E5 /* MPAutotypeDaemon.m */,
4C61251A21B94BDD00A93924 /* MPAutotypeExecutionContext.h */,
4C61251B21B94BDD00A93924 /* MPAutotypeExecutionContext.m */,
4CD2B9041849424B0051B395 /* MPAutotypeContext.h */,
4CD2B9051849424B0051B395 /* MPAutotypeContext.m */,
4CA3530918A53CB800839B0F /* MPKeyMapper.h */,
@@ -2028,7 +2023,6 @@
4CE082C31F6FCD2A0034FF56 /* MPCollectionView.m in Sources */,
4C4A100F176286FD00BBF2CA /* MPTableView.m in Sources */,
4CA334CA18AD60D1008A3322 /* MPWindowAssociationsTableViewDelegate.m in Sources */,
4C61251C21B94BDD00A93924 /* MPAutotypeExecutionContext.m in Sources */,
4C01C2421764D8980016D5D0 /* MPContextMenuHelper.m in Sources */,
4CE296191842A166005F01CE /* MPAutotypePaste.m in Sources */,
4C569D9E17652B0600595B62 /* MPConstants.m in Sources */,

View File

@@ -57,7 +57,7 @@
* Designated initializer
*
* @param entry Entry to use
* @param sequence Keystroke Sequence to use
* @param sequence Keystroke Sequence to use, this is usefull to override any sequences stored in the entry
*
* @return AutotypeSequnce with the entry and keystroke in places
*/

View File

@@ -31,7 +31,6 @@
*/
@interface MPAutotypeDaemon : NSObject
@property (strong, readonly) MPAutotypeExecutionContext *executionContext;
@property (strong) IBOutlet NSWindow *matchSelectionWindow;
@property (weak) IBOutlet NSPopUpButton *matchSelectionButton;
@property (readonly, strong) DDHotKey *registredHotKey;

View File

@@ -25,7 +25,6 @@
#import "MPDocumentWindowController.h"
#import "MPAutotypeCommand.h"
#import "MPAutotypeContext.h"
#import "MPAutotypeExecutionContext.h"
#import "MPAutotypePaste.h"
#import "MPPasteBoardController.h"
#import "MPSettingsHelper.h"
@@ -53,7 +52,6 @@ NSString *const kMPProcessIdentifierKey = @"kMPProcessIdentifierKey";
@property (copy) NSString *targetWindowTitle; // The title of the window that we are targeting
@property (strong) NSRunningApplication *previousApplication; // The application that was active before we got invoked
@property (assign) NSTimeInterval userActionRequested;
@property (strong, readwrite) MPAutotypeExecutionContext *executionContext;
@end
@@ -317,17 +315,15 @@ static MPAutotypeDaemon *_sharedInstance;
if([self _orderApplicationToFront:self.targetPID]) {
/* Sleep a bit after the app was activated */
/* TODO - we can use a saver way and use a notification to check if the app actally was activated */
/* TODO - we might be able to a notification to check if the app actally was activated instead of guessing a waiting time */
usleep(1 * NSEC_PER_MSEC);
}
self.executionContext = [[MPAutotypeExecutionContext alloc] initWithTargetPid:self.targetPID];
for(MPAutotypeCommand *command in [MPAutotypeCommand commandsForContext:context]) {
/* dispatch commands to main thread since most of them translate key events which is disallowed on background thread */
dispatch_async(dispatch_get_main_queue(), ^{
[command execute];
});
}
self.executionContext = nil;
}
#pragma mark -

View File

@@ -1,22 +0,0 @@
//
// MPAutotypeExectutionContext.h
// MacPass
//
// Created by Michael Starke on 06.12.18.
// Copyright © 2018 HicknHack Software GmbH. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface MPAutotypeExecutionContext : NSObject
@property (readonly) pid_t targetPid;
- (instancetype)initWithTargetPid:(pid_t)pid NS_DESIGNATED_INITIALIZER;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,27 +0,0 @@
//
// MPAutotypeExectutionContext.m
// MacPass
//
// Created by Michael Starke on 06.12.18.
// Copyright © 2018 HicknHack Software GmbH. All rights reserved.
//
#import "MPAutotypeExecutionContext.h"
@interface MPAutotypeExecutionContext ()
@property (readwrite) pid_t targetPid;
@end
@implementation MPAutotypeExecutionContext
- (instancetype)initWithTargetPid:(pid_t)pid {
self = [super init];
if(self) {
self.targetPid = pid;
}
return self;
}
@end

View File

@@ -111,7 +111,7 @@
/* Fall back to preferred Entry if no match was found */
if(usePreferredEntry && contexts.count == 0 ) {
context = [[MPAutotypeContext alloc] initWithEntry:entry andSequence:entry.autotype.defaultKeystrokeSequence];
context = [[MPAutotypeContext alloc] initWithDefaultSequenceForEntry:entry];
if(context.valid) {
[contexts addObject:context];
}

View File

@@ -9,7 +9,6 @@
#import "MPKeyTyper.h"
#import "MPKeyMapper.h"
#import "MPAutotypeDaemon.h"
#import "MPAutotypeExecutionContext.h"
@implementation MPKeyTyper