From ffae9da1d37b717cc7ef668397f7f20eea6b4177 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Fri, 21 Jun 2013 11:46:00 +0700 Subject: [PATCH] =?UTF-8?q?Only=20skip=20setting=20search=20folder=20for?= =?UTF-8?q?=20=E2=87=A7=E2=8C=98F=20if=20already=20=E2=80=9Cowner=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The user may use ⇧⌘F either to bring existing results to front, or to start a new folder search for a potential different project. If the dialog is not visible, we always initialize it fully. If already visible, we previously would not setup search folder since the current search folder might have been manually set by the user, which we do not want to overwrite. --- Frameworks/DocumentWindow/src/DocumentController.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Frameworks/DocumentWindow/src/DocumentController.mm b/Frameworks/DocumentWindow/src/DocumentController.mm index b80c7e49..c1244a90 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.mm +++ b/Frameworks/DocumentWindow/src/DocumentController.mm @@ -1778,6 +1778,7 @@ namespace - (IBAction)orderFrontFindPanel:(id)sender { Find* find = [Find sharedInstance]; + BOOL didOwnDialog = [find.projectIdentifier isEqualToString:self.identifier]; find.documentIdentifier = self.selectedDocumentUUID; find.projectFolder = self.projectPath ?: self.untitledSavePath ?: NSHomeDirectory(); find.projectIdentifier = self.identifier; @@ -1796,7 +1797,7 @@ namespace { BOOL fileBrowserHasFocus = [self.window.firstResponder respondsToSelector:@selector(isDescendantOf:)] && [(NSView*)self.window.firstResponder isDescendantOf:self.fileBrowser.view]; NSString* searchFolder = fileBrowserHasFocus ? self.untitledSavePath : find.projectFolder; - if(find.isVisible && find.searchFolder) + if(find.isVisible && find.searchFolder && didOwnDialog) // don’t reset search folder, as the user may have picked “Other…” and simply wants the results brought to front searchFolder = find.searchFolder; [find showFindWindowFor:searchFolder]; }