Use data source’s root item’s title in file browser header

This is instead of simply asking for the root URL’s display name, as the data source can provide a more specialized display name.
This commit is contained in:
Allan Odgaard
2013-02-02 10:34:23 +01:00
parent 57f4589dbb
commit 4138c2a3d5

View File

@@ -189,6 +189,10 @@ static NSMutableSet* SymmetricDifference (NSMutableSet* aSet, NSMutableSet* anot
for(NSURL* currentURL = _url; currentURL; currentURL = ParentForURL(currentURL))
{
NSMenuItem* menuItem = [menu addItemWithTitle:DisplayName(currentURL) action:@selector(takeURLFrom:) keyEquivalent:@""];
if(currentURL == _url && _outlineViewDelegate.dataSource)
menuItem.title = _outlineViewDelegate.dataSource.rootItem.name;
[menuItem setTarget:self];
[menuItem setRepresentedObject:currentURL];
[menuItem setImage:IconImage(currentURL)];