mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-23 11:29:31 +00:00
Using new KeePassKit API for Tags
Signed-off-by: michael starke <michael.starke@hicknhack-software.com>
This commit is contained in:
@@ -91,8 +91,7 @@
|
||||
}
|
||||
/* test for tags */
|
||||
if(matchTags && !foundMatch) {
|
||||
NSArray *tags = [entry.tags componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@".:;"]];
|
||||
for(NSString *tag in tags) {
|
||||
for(NSString *tag in entry.tags) {
|
||||
foundMatch = ([windowTitle rangeOfString:tag options:NSCaseInsensitiveSearch].length != 0);
|
||||
if(foundMatch) {
|
||||
break;
|
||||
|
||||
13
MacPass/MPTagsTokenFieldDelegate.h
Normal file
13
MacPass/MPTagsTokenFieldDelegate.h
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// MPTagsTokenFieldDelegate.h
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 30/09/15.
|
||||
// Copyright © 2015 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface MPTagsTokenFieldDelegate : NSObject <NSTokenFieldDelegate>
|
||||
|
||||
@end
|
||||
30
MacPass/MPTagsTokenFieldDelegate.m
Normal file
30
MacPass/MPTagsTokenFieldDelegate.m
Normal file
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// MPTagsTokenFieldDelegate.m
|
||||
// MacPass
|
||||
//
|
||||
// Created by Michael Starke on 30/09/15.
|
||||
// Copyright © 2015 HicknHack Software GmbH. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPTagsTokenFieldDelegate.h"
|
||||
|
||||
@implementation MPTagsTokenFieldDelegate
|
||||
|
||||
// Each element in the array should be an NSString or an array of NSStrings.
|
||||
// substring is the partial string that is being completed. tokenIndex is the index of the token being completed.
|
||||
// selectedIndex allows you to return by reference an index specifying which of the completions should be selected initially.
|
||||
// The default behavior is not to have any completions.
|
||||
//- (nullable NSArray *)tokenField:(NSTokenField *)tokenField completionsForSubstring:(NSString *)substring indexOfToken:(NSInteger)tokenIndex indexOfSelectedItem:(nullable NSInteger *)selectedIndex;
|
||||
|
||||
// return an array of represented objects you want to add.
|
||||
// If you want to reject the add, return an empty array.
|
||||
// returning nil will cause an error.
|
||||
//- (NSArray *)tokenField:(NSTokenField *)tokenField shouldAddObjects:(NSArray *)tokens atIndex:(NSUInteger)index;
|
||||
|
||||
// If you return nil or don't implement these delegate methods, we will assume
|
||||
// editing string = display string = represented object
|
||||
//- (nullable NSString *)tokenField:(NSTokenField *)tokenField displayStringForRepresentedObject:(id)representedObject;
|
||||
//- (nullable NSString *)tokenField:(NSTokenField *)tokenField editingStringForRepresentedObject:(id)representedObject;
|
||||
//- (id)tokenField:(NSTokenField *)tokenField representedObjectForEditingString: (NSString *)editingString;
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user