Tags are now search case insensitive (fixes #1048)

The issue was that the tags string array was not correctly searched case insensitive via the predicate CONTAINS
This commit is contained in:
Michael Starke
2020-03-25 21:03:28 +01:00
parent 3731e92339
commit d7f6bcc6c3
11 changed files with 123 additions and 44 deletions

View File

@@ -115,6 +115,7 @@
4C45FB30178E0CE20010007D /* MPTestDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C45FB2F178E0CE20010007D /* MPTestDocument.m */; };
4C46B88517063A070046109A /* NSString+MPPasswordCreation.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */; };
4C473A8718AFD85B0073FD2E /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C473A8518AFD7250073FD2E /* XCTest.framework */; };
4C49CFD624252389004092E7 /* KPKEntry+MPTags.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C49CFD524252389004092E7 /* KPKEntry+MPTags.m */; };
4C4A100F176286FD00BBF2CA /* MPTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4A100E176286FD00BBF2CA /* MPTableView.m */; };
4C4B728518E4B9B400A1A5D5 /* MPDockTileHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B728418E4B9B400A1A5D5 /* MPDockTileHelper.m */; };
4C4B7EE917A45EC6000234C7 /* MPDatePickingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C4B7EE717A45EC5000234C7 /* MPDatePickingViewController.m */; };
@@ -277,7 +278,7 @@
4CF29BF417879D0000851B60 /* 26_FileSaveTemplate.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 4CF29BF317879D0000851B60 /* 26_FileSaveTemplate.pdf */; };
4CF5BE6D1BF33E3000048505 /* NSApplication+MPAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF5BE6C1BF33E3000048505 /* NSApplication+MPAdditions.m */; };
4CF6653820E67A140008A25C /* PluginDataView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4CF6653A20E67A140008A25C /* PluginDataView.xib */; };
4CF6C3021FBF39BF0055AD03 /* MPPluginTabelCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF6C3011FBF39BF0055AD03 /* MPPluginTabelCellView.m */; };
4CF6C3021FBF39BF0055AD03 /* MPExtendedTableCellView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF6C3011FBF39BF0055AD03 /* MPExtendedTableCellView.m */; };
4CF6C711176F4533007A811D /* MPStringLengthValueTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF6C710176F4533007A811D /* MPStringLengthValueTransformer.m */; };
4CF78064176E75AD0032EE71 /* MPIntegrationPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CF78063176E75AD0032EE71 /* MPIntegrationPreferencesController.m */; };
4CFB18E418A17FA20097A34B /* MPUpdatePreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4CFB18E318A17FA20097A34B /* MPUpdatePreferencesController.m */; };
@@ -528,6 +529,8 @@
4C46B88317063A070046109A /* NSString+MPPasswordCreation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+MPPasswordCreation.h"; sourceTree = "<group>"; };
4C46B88417063A070046109A /* NSString+MPPasswordCreation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+MPPasswordCreation.m"; sourceTree = "<group>"; };
4C473A8518AFD7250073FD2E /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
4C49CFD424252389004092E7 /* KPKEntry+MPTags.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "KPKEntry+MPTags.h"; sourceTree = "<group>"; };
4C49CFD524252389004092E7 /* KPKEntry+MPTags.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "KPKEntry+MPTags.m"; sourceTree = "<group>"; };
4C4A100D176286FD00BBF2CA /* MPTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPTableView.h; sourceTree = "<group>"; };
4C4A100E176286FD00BBF2CA /* MPTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPTableView.m; sourceTree = "<group>"; };
4C4B2ED122D8CA6100EB6BFD /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/PluginRepositoryBrowserView.strings; sourceTree = "<group>"; };
@@ -854,8 +857,8 @@
4CF5BE6C1BF33E3000048505 /* NSApplication+MPAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSApplication+MPAdditions.m"; sourceTree = "<group>"; };
4CF6653920E67A140008A25C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/PluginDataView.xib; sourceTree = "<group>"; };
4CF6653E20E67A1A0008A25C /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/PluginDataView.strings; sourceTree = "<group>"; };
4CF6C3001FBF39BF0055AD03 /* MPPluginTabelCellView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPPluginTabelCellView.h; sourceTree = "<group>"; };
4CF6C3011FBF39BF0055AD03 /* MPPluginTabelCellView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPPluginTabelCellView.m; sourceTree = "<group>"; };
4CF6C3001FBF39BF0055AD03 /* MPExtendedTableCellView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MPExtendedTableCellView.h; sourceTree = "<group>"; };
4CF6C3011FBF39BF0055AD03 /* MPExtendedTableCellView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MPExtendedTableCellView.m; sourceTree = "<group>"; };
4CF6C70F176F4533007A811D /* MPStringLengthValueTransformer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPStringLengthValueTransformer.h; sourceTree = "<group>"; };
4CF6C710176F4533007A811D /* MPStringLengthValueTransformer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MPStringLengthValueTransformer.m; sourceTree = "<group>"; };
4CF78062176E75AD0032EE71 /* MPIntegrationPreferencesController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MPIntegrationPreferencesController.h; sourceTree = "<group>"; };
@@ -1095,8 +1098,8 @@
4CCEDE29179F203B008402BE /* MPOutlineView.m */,
4CE082C11F6FCD2A0034FF56 /* MPCollectionView.h */,
4CE082C21F6FCD2A0034FF56 /* MPCollectionView.m */,
4CF6C3001FBF39BF0055AD03 /* MPPluginTabelCellView.h */,
4CF6C3011FBF39BF0055AD03 /* MPPluginTabelCellView.m */,
4CF6C3001FBF39BF0055AD03 /* MPExtendedTableCellView.h */,
4CF6C3011FBF39BF0055AD03 /* MPExtendedTableCellView.m */,
4C0F043E2147A6FA000B8568 /* MPCustomFieldTableView.h */,
4C0F043F2147A6FA000B8568 /* MPCustomFieldTableView.m */,
4C370EFC215B76CB00703AAE /* MPOutlineTableCellView.h */,
@@ -1142,6 +1145,8 @@
3C0CDECE21CFEDD200B2A10B /* NSTextView+MPTouchBarExtension.m */,
4C2057F523CF3E9A00C731EC /* NSRunningApplication+MPAdditions.h */,
4C2057F623CF3E9A00C731EC /* NSRunningApplication+MPAdditions.m */,
4C49CFD424252389004092E7 /* KPKEntry+MPTags.h */,
4C49CFD524252389004092E7 /* KPKEntry+MPTags.m */,
);
name = Categories;
sourceTree = "<group>";
@@ -2040,6 +2045,7 @@
4C735FC02035FCBF00708D53 /* MPPluginEntryActionContext.m in Sources */,
4C61EA0316D2FD0800AC519E /* MPOutlineViewController.m in Sources */,
4C65C79C16DD283900E32CFF /* MPToolbarButton.m in Sources */,
4C49CFD624252389004092E7 /* KPKEntry+MPTags.m in Sources */,
4C431BCD16E2A82800700A81 /* MPPasteBoardController.m in Sources */,
4C6AEEF91A043E2B00CA2420 /* MPDocumentController.m in Sources */,
4C370EFE215B76CB00703AAE /* MPOutlineTableCellView.m in Sources */,
@@ -2097,7 +2103,7 @@
4C5FE9AE17843CE20001D5A8 /* MPSelectedAttachmentTableCellView.m in Sources */,
4CC59C2721AF0893005E8D6B /* MPPathControl.m in Sources */,
4C3666411787327E00B249F1 /* MPDocument+Attachments.m in Sources */,
4CF6C3021FBF39BF0055AD03 /* MPPluginTabelCellView.m in Sources */,
4CF6C3021FBF39BF0055AD03 /* MPExtendedTableCellView.m in Sources */,
4C10412C178CDD44001B5239 /* NSDate+Humanized.m in Sources */,
4C58A4A32192EC1600B13370 /* NSIndexPath+MPAdditions.m in Sources */,
4C2F17A21FD69BCA0097418D /* MPUserNotificationCenterDelegate.m in Sources */,

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -20,13 +20,13 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="241"/>
<subviews>
<scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="38" horizontalPageScroll="10" verticalLineScroll="38" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7cB-re-3ys">
<rect key="frame" x="20" y="61" width="440" height="118"/>
<rect key="frame" x="20" y="61" width="440" height="120"/>
<clipView key="contentView" id="WSc-o2-GsZ">
<rect key="frame" x="1" y="1" width="438" height="116"/>
<rect key="frame" x="1" y="1" width="438" height="118"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="36" viewBased="YES" id="Ih2-lo-t2W">
<rect key="frame" x="0.0" y="0.0" width="438" height="116"/>
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" typeSelect="NO" rowHeight="36" viewBased="YES" id="Ih2-lo-t2W">
<rect key="frame" x="0.0" y="0.0" width="438" height="118"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -45,12 +45,12 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES"/>
<prototypeCellViews>
<tableCellView id="vkI-FK-7wg">
<tableCellView misplaced="YES" id="vkI-FK-7wg" customClass="MPExtendedTableCellView">
<rect key="frame" x="1" y="1" width="435" height="17"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Utl-Gl-ETE">
<rect key="frame" x="2" y="1" width="14" height="14"/>
<rect key="frame" x="2" y="20" width="14" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="lessThanOrEqual" constant="32" id="N48-cx-w8q"/>
<constraint firstAttribute="height" relation="lessThanOrEqual" constant="32" id="mde-14-jf7"/>
@@ -58,8 +58,16 @@
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSActionTemplate" id="gT4-lt-7Ir"/>
</imageView>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Dxk-A7-QSy">
<rect key="frame" x="22" y="0.0" width="413" height="17"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Content" id="TN3-3a-LaA">
<rect key="frame" x="22" y="20" width="413" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Title" id="TN3-3a-LaA">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" allowsExpansionToolTips="YES" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rHv-KR-Ja6">
<rect key="frame" x="22" y="2" width="413" height="16"/>
<textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Sequence" id="bvJ-2i-eMc">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
@@ -67,14 +75,18 @@
</textField>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="Dxk-A7-QSy" secondAttribute="bottom" id="0Ds-yc-1wj"/>
<constraint firstItem="Dxk-A7-QSy" firstAttribute="top" secondItem="vkI-FK-7wg" secondAttribute="top" id="3KK-oo-Ogk"/>
<constraint firstAttribute="bottom" secondItem="rHv-KR-Ja6" secondAttribute="bottom" constant="2" id="Fct-2X-0MX"/>
<constraint firstItem="Dxk-A7-QSy" firstAttribute="leading" secondItem="Utl-Gl-ETE" secondAttribute="trailing" constant="8" symbolic="YES" id="L0l-PB-4Dt"/>
<constraint firstItem="rHv-KR-Ja6" firstAttribute="leading" secondItem="Dxk-A7-QSy" secondAttribute="leading" id="cHl-VR-d3w"/>
<constraint firstAttribute="trailing" secondItem="rHv-KR-Ja6" secondAttribute="trailing" constant="2" id="jqL-Dd-V0M"/>
<constraint firstAttribute="trailing" secondItem="Dxk-A7-QSy" secondAttribute="trailing" constant="2" id="kOy-Jo-rYe"/>
<constraint firstItem="Utl-Gl-ETE" firstAttribute="leading" secondItem="vkI-FK-7wg" secondAttribute="leading" constant="2" id="rRi-nE-1Z3"/>
<constraint firstItem="Utl-Gl-ETE" firstAttribute="top" secondItem="vkI-FK-7wg" secondAttribute="top" constant="2" id="sJf-FS-87E"/>
<constraint firstItem="rHv-KR-Ja6" firstAttribute="top" secondItem="Dxk-A7-QSy" secondAttribute="bottom" constant="2" id="uTd-5E-IzI"/>
</constraints>
<connections>
<outlet property="addionalTextField" destination="rHv-KR-Ja6" id="VTf-Dz-qYp"/>
<outlet property="imageView" destination="Utl-Gl-ETE" id="5dQ-R4-kfV"/>
<outlet property="textField" destination="Dxk-A7-QSy" id="8uP-9M-aOd"/>
</connections>
@@ -100,7 +112,7 @@
</scroller>
</scrollView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" preferredMaxLayoutWidth="330" translatesAutoresizingMaskIntoConstraints="NO" id="kDw-2l-7gQ">
<rect key="frame" x="18" y="187" width="444" height="34"/>
<rect key="frame" x="18" y="189" width="444" height="32"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="There are multiple matches for the current window. Please select which match should be used." id="gcf-gb-ZsF">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -148,7 +160,7 @@ DQ
<constraint firstItem="7cB-re-3ys" firstAttribute="top" secondItem="kDw-2l-7gQ" secondAttribute="bottom" constant="8" symbolic="YES" id="ss6-Ku-XPY"/>
<constraint firstAttribute="trailing" secondItem="kDw-2l-7gQ" secondAttribute="trailing" constant="20" symbolic="YES" id="zSz-fH-fVn"/>
</constraints>
<point key="canvasLocation" x="176" y="-39"/>
<point key="canvasLocation" x="176" y="-39.5"/>
</customView>
</objects>
<resources>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="15705" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="15705"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -34,7 +34,7 @@
<rect key="frame" x="20" y="20" width="369" height="260"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="qPL-FR-ky7">
<rect key="frame" x="18" y="223" width="333" height="17"/>
<rect key="frame" x="18" y="224" width="333" height="16"/>
<textFieldCell key="cell" controlSize="mini" sendsActionOnEndEditing="YES" title="Plugin Settings Info" id="OOr-SW-jZb">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -80,7 +80,7 @@
<rect key="frame" x="1" y="1" width="148" height="298"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="35" rowSizeStyle="automatic" viewBased="YES" id="Ocu-C0-03d">
<tableView verticalHuggingPriority="750" ambiguous="YES" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" columnResizing="NO" multipleSelection="NO" autosaveColumns="NO" rowHeight="35" usesAutomaticRowHeights="YES" viewBased="YES" id="Ocu-C0-03d">
<rect key="frame" x="0.0" y="0.0" width="148" height="298"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
@@ -100,12 +100,12 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
<tableCellView id="vVt-P3-yLp" customClass="MPPluginTabelCellView">
<tableCellView misplaced="YES" id="vVt-P3-yLp" customClass="MPExtendedTableCellView">
<rect key="frame" x="1" y="1" width="145" height="35"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" setsMaxLayoutWidthAtFirstLayout="YES" translatesAutoresizingMaskIntoConstraints="NO" id="q1P-PD-0LW">
<rect key="frame" x="0.0" y="18" width="145" height="17"/>
<rect key="frame" x="0.0" y="18" width="145" height="16"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="Table View Cell" id="fug-79-n9g">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@@ -155,7 +155,7 @@
</scroller>
</scrollView>
<segmentedControl verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="B9Q-hq-K4N">
<rect key="frame" x="20" y="19" width="71" height="23"/>
<rect key="frame" x="19.5" y="19" width="71" height="23"/>
<segmentedCell key="cell" borderStyle="border" alignment="left" style="texturedSquare" trackingMode="momentary" id="cj3-R6-g1E">
<font key="font" metaFont="system"/>
<segments>
@@ -168,7 +168,7 @@
</connections>
</segmentedControl>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="SNe-cc-CZs">
<rect key="frame" x="413" y="19" width="174" height="23"/>
<rect key="frame" x="413.5" y="19" width="174" height="23"/>
<buttonCell key="cell" type="roundTextured" title="Browse Available Plugins…" bezelStyle="texturedRounded" alignment="center" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="sqO-8H-n1y">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>

22
MacPass/KPKEntry+MPTags.h Normal file
View File

@@ -0,0 +1,22 @@
//
// KPKEntry+MPTags.h
// MacPass
//
// Created by Michael Starke on 20.03.20.
// Copyright © 2020 HicknHack Software GmbH. All rights reserved.
//
#import <AppKit/AppKit.h>
#import <KeePassKit/KeePassKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KPKEntry (MPTags)
@property (readonly, copy) NSString *tagsString;
@end
NS_ASSUME_NONNULL_END

24
MacPass/KPKEntry+MPTags.m Normal file
View File

@@ -0,0 +1,24 @@
//
// KPKEntry+MPTags.m
// MacPass
//
// Created by Michael Starke on 20.03.20.
// Copyright © 2020 HicknHack Software GmbH. All rights reserved.
//
#import "KPKEntry+MPTags.h"
#import <AppKit/AppKit.h>
@implementation KPKEntry (MPTags)
+ (NSSet<NSString *> *)keyPathsForValuesAffectingTagsString {
return [NSSet setWithObject:NSStringFromSelector(@selector(tags))];
}
- (NSString *)tagsString {
return [self.tags componentsJoinedByString:@" "];
}
@end

View File

@@ -23,6 +23,7 @@
#import "MPAutotypeContext.h"
#import "MPAutotypeDaemon.h"
#import "MPAutotypeEnvironment.h"
#import "MPExtendedTableCellView.h"
#import "KPKNode+IconImage.h"
@@ -59,12 +60,10 @@
#pragma mark NSTableViewDelegate
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
NSTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
MPExtendedTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:self];
MPAutotypeContext *context = self.candidates[row];
NSString *maskedEvaluatedCommand = context.maskedEvaluatedCommand;
NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:[NSString stringWithFormat:@"%@\n%@", context.entry.title, maskedEvaluatedCommand]];
[string setAttributes:@{NSForegroundColorAttributeName: NSColor.disabledControlTextColor} range:NSMakeRange((string.length - maskedEvaluatedCommand.length), maskedEvaluatedCommand.length)];
view.textField.attributedStringValue = string;
view.addionalTextField.stringValue = context.maskedEvaluatedCommand;
view.textField.stringValue = context.entry.title;
view.imageView.image = context.entry.iconImage;
return view;
}

View File

@@ -64,7 +64,7 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
MPDocument __weak *weakSelf = self;
dispatch_queue_t backgroundQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_async(backgroundQueue, ^{
NSArray *results = [weakSelf _findEntriesMatchingCurrentSearch];
NSArray *results = [weakSelf _findEntriesMatchingSearch:weakSelf.searchContext];
dispatch_sync(dispatch_get_main_queue(), ^{
[NSNotificationCenter.defaultCenter postNotificationName:MPDocumentDidChangeSearchResults object:weakSelf userInfo:@{ kMPDocumentSearchResultsKey: results }];
});
@@ -128,9 +128,9 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
}
#pragma mark Search
- (NSArray *)_findEntriesMatchingCurrentSearch {
- (NSArray *)_findEntriesMatchingSearch:(MPEntrySearchContext *)context {
/* Filter double passwords */
if(MPIsFlagSetInOptions(MPEntrySearchDoublePasswords, self.searchContext.searchFlags)) {
if(MPIsFlagSetInOptions(MPEntrySearchDoublePasswords, context.searchFlags)) {
NSMutableDictionary *passwordToEntryMap = [[NSMutableDictionary alloc] initWithCapacity:100];
/* Build up a usage map */
for(KPKEntry *entry in self.root.searchableChildEntries) {
@@ -155,7 +155,7 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
}
return doublePasswords;
}
if(MPIsFlagSetInOptions(MPEntrySearchExpiredEntries, self.searchContext.searchFlags)) {
if(MPIsFlagSetInOptions(MPEntrySearchExpiredEntries, context.searchFlags)) {
NSPredicate *expiredPredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *bindings) {
KPKNode *node = evaluatedObject;
return node.timeInfo.isExpired;
@@ -163,7 +163,7 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
return [[self.root searchableChildEntries] filteredArrayUsingPredicate:expiredPredicate];
}
/* Filter using predicates */
NSArray *predicates = [self _filterPredicatesWithString:self.searchContext.searchString];
NSArray *predicates = [self _filterPredicatesWithString:context.searchString];
if(predicates) {
NSPredicate *fullFilter = [NSCompoundPredicate orPredicateWithSubpredicates:predicates];
return [[self.root searchableChildEntries] filteredArrayUsingPredicate:fullFilter];
@@ -194,7 +194,7 @@ NSString *const kMPDocumentSearchResultsKey = @"kMPDocumentSearchResul
[prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.notes CONTAINS[cd] %@", string]];
}
if(searchInAllAttributes) {
[prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.tags CONTAINS[cd] %@", string]];
[prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.tagsString CONTAINS[cd] %@", string]];
[prediactes addObject:[NSPredicate predicateWithFormat:@"SELF.uuid.UUIDString CONTAINS[cd] %@", string]];
NSPredicate *allAttributesPredicate = [NSPredicate predicateWithBlock:^BOOL(id _Nullable evaluatedObject, NSDictionary<NSString *,id> * _Nullable bindings) {

View File

@@ -22,7 +22,7 @@
#import <Cocoa/Cocoa.h>
@interface MPPluginTabelCellView : NSTableCellView
@interface MPExtendedTableCellView : NSTableCellView
@property (strong) IBOutlet NSTextField *addionalTextField;

View File

@@ -20,9 +20,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#import "MPPluginTabelCellView.h"
#import "MPExtendedTableCellView.h"
@implementation MPPluginTabelCellView
@implementation MPExtendedTableCellView
- (void)setBackgroundStyle:(NSBackgroundStyle)backgroundStyle {
super.backgroundStyle = backgroundStyle;

View File

@@ -21,7 +21,7 @@
//
#import "MPPluginPreferencesController.h"
#import "MPPluginTabelCellView.h"
#import "MPExtendedTableCellView.h"
#import "MPPluginHost.h"
#import "MPPlugin.h"
#import "MPPlugin_Private.h"
@@ -98,7 +98,7 @@ typedef NS_ENUM(NSUInteger, MPPluginSegmentType) {
- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
MPPlugin *plugin = [self pluginForRow:row];
MPPluginTabelCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:nil];
MPExtendedTableCellView *view = [tableView makeViewWithIdentifier:tableColumn.identifier owner:nil];
if(plugin.enabled) {
view.textField.stringValue = plugin.name;
}

View File

@@ -14,6 +14,21 @@
NSString *const MPWindowTitleKey = @"MPWindowTitleKey";
NSString *const MPProcessIdentifierKey = @"MPProcessIdentifierKey";
BOOL skipWindowTitle(NSString *windowTitle) {
if(windowTitle.length <= 0) {
return YES;
}
static NSSet *titlesToSkip;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
titlesToSkip = [NSSet setWithArray:@[@"Item-0", @"Focus Proxy"]];
});
return [titlesToSkip containsObject:windowTitle];
}
@implementation NSRunningApplication (MPAdditions)
- (NSDictionary *)mp_infoDictionary {
@@ -23,7 +38,8 @@ NSString *const MPProcessIdentifierKey = @"MPProcessIdentifierKey";
NSDictionary *infoDict = nil;
for(NSDictionary *windowDict in currentWindows) {
NSString *windowTitle = windowDict[(NSString *)kCGWindowName];
if(windowTitle.length <= 0) {
/* skip a list of well know useless window-titles */
if(skipWindowTitle(windowTitle)) {
continue;
}
NSNumber *processId = windowDict[(NSString *)kCGWindowOwnerPID];