Clear file chooser filter string

Now that we re-use the window we need to manually clear the filter string (from last use).
This commit is contained in:
Allan Odgaard
2013-01-23 20:54:45 +01:00
parent 4beb62f2dc
commit 3026480a0d

View File

@@ -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];
}