Ignore folders when opening multiple items from file browser

Previously we would descend into the first selected folder, ignoring all other items selected. Now we ignore the folders, unless all items selected are folders, in that case, we descend into the first one.
This commit is contained in:
Allan Odgaard
2016-09-09 11:38:09 +02:00
parent 3e2fa79945
commit 24f98894e7

View File

@@ -1022,6 +1022,7 @@ static bool is_binary (std::string const& path)
- (void)openItems:(NSArray*)items animate:(BOOL)animateFlag
{
NSMutableArray* urlsToOpen = [NSMutableArray array];
NSMutableArray* urlsToShow = [NSMutableArray array];
NSMutableArray* itemsToAnimate = [NSMutableArray array];
for(FSItem* item in items)
@@ -1045,7 +1046,7 @@ static bool is_binary (std::string const& path)
{
case FSItemURLTypeFolder:
case FSItemURLTypeUnknown:
return [self goToURL:itemURL];
[urlsToShow addObject:itemURL];
break;
case FSItemURLTypePackage:
@@ -1060,6 +1061,9 @@ static bool is_binary (std::string const& path)
}
}
if(itemsToAnimate.count == 0 && urlsToShow.count > 0)
return [self goToURL:urlsToShow.firstObject];
if(animateFlag && ![[NSUserDefaults standardUserDefaults] boolForKey:kUserDefaultsFileBrowserOpenAnimationDisabled])
{
for(FSItem* item in itemsToAnimate)