Skip to content

Commit

Permalink
libcore|FileIndex: Cannot look for files inside single-file packages
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 17, 2016
1 parent 2595f19 commit 750ae05
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions doomsday/sdk/libcore/src/filesys/fileindex.cpp
Expand Up @@ -171,13 +171,17 @@ void FileIndex::findPartialPath(Folder const &rootFolder, String const &path,
void FileIndex::findPartialPath(String const &packageId, String const &path,
FoundFiles &found) const
{
findPartialPath(App::packageLoader().package(packageId).root(),
path, found, FindInEntireIndex);
// We can only look in Folder-like packages.
Package const &pkg = App::packageLoader().package(packageId);
if(pkg.file().is<Folder>())
{
findPartialPath(pkg.root(), path, found, FindInEntireIndex);

// Remove any matches not in the given package.
found.remove_if([&packageId] (File *file) {
return Package::identifierForContainerOfFile(*file) != packageId;
});
// Remove any matches not in the given package.
found.remove_if([&packageId](File *file) {
return Package::identifierForContainerOfFile(*file) != packageId;
});
}
}

int FileIndex::findPartialPathInPackageOrder(String const &path, FoundFiles &found, Behavior behavior) const
Expand Down

0 comments on commit 750ae05

Please sign in to comment.