From e62ef9cf6d131e4382e6ea42fc865645bff75997 Mon Sep 17 00:00:00 2001 From: Allan Odgaard Date: Mon, 18 Feb 2013 15:34:29 +0100 Subject: [PATCH] Re-use file icon image MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are expensive to create and it was noticeable when lots of files matched and the menu had to be created (as it would when the user press a potential menu key like ⌘W). --- Frameworks/Find/src/FFWindowController.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/Find/src/FFWindowController.mm b/Frameworks/Find/src/FFWindowController.mm index 1d5ce80e..f9f6388b 100644 --- a/Frameworks/Find/src/FFWindowController.mm +++ b/Frameworks/Find/src/FFWindowController.mm @@ -289,7 +289,7 @@ struct operation_t std::string const& title = doc->path() == NULL_STR ? doc->display_name() : path::relative_to(doc->path(), [[self rootPath] UTF8String]); NSString* shortcut = key < 11 ? [NSString stringWithFormat:@"%lu", (key++ % 10)] : @""; NSMenuItem* item = [menu addItemWithTitle:[NSString stringWithCxxString:title] action:@selector(selectMatchingPath:) keyEquivalent:shortcut]; - [item setIconForFile:match.path]; + [item setImage:match.icon]; [item setRepresentedObject:match.path]; } }