From 3026480a0de77235382515c7e28f450421fdbcb4 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Wed, 23 Jan 2013 20:54:45 +0100 Subject: [PATCH] Clear file chooser filter string Now that we re-use the window we need to manually clear the filter string (from last use). --- .../DocumentWindow/src/DocumentController.mm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Frameworks/DocumentWindow/src/DocumentController.mm b/Frameworks/DocumentWindow/src/DocumentController.mm index 279be08a..80e337c6 100644 --- a/Frameworks/DocumentWindow/src/DocumentController.mm +++ b/Frameworks/DocumentWindow/src/DocumentController.mm @@ -1448,13 +1448,7 @@ namespace { FileChooser* fc = [FileChooser sharedInstance]; - if(OakPasteboardEntry* entry = [[OakPasteboard pasteboardWithName:NSFindPboard] current]) - { - std::string str = to_s(entry.string); - if(regexp::search("\\A.*?(\\.|/).*?:\\d+\\z", str.data(), str.data() + str.size())) - fc.filterString = entry.string; - } - + fc.filterString = @""; fc.openDocuments = _documents; fc.currentDocument = _selectedDocument ? _selectedDocument->identifier() : oak::uuid_t(); fc.scmInfo = _scmInfo; @@ -1462,6 +1456,13 @@ namespace fc.action = @selector(fileChooserDidSelectItems:); fc.path = self.projectPath ?: self.untitledSavePath ?: NSHomeDirectory(); + if(OakPasteboardEntry* entry = [[OakPasteboard pasteboardWithName:NSFindPboard] current]) + { + std::string str = to_s(entry.string); + if(regexp::search("\\A.*?(\\.|/).*?:\\d+\\z", str.data(), str.data() + str.size())) + fc.filterString = entry.string; + } + [fc showWindowRelativeToWindow:self.window]; }