Skip to content

Commit

Permalink
Fixed|FS|libcore: Find all packages under /home
Browse files Browse the repository at this point in the history
DirectoryFeed constructor was changed so that subfolder population
must be specifically requested. However, some calls were being made
with flags that overrode the defaults, meaning subfolders of /home
were not being populated correctly.
  • Loading branch information
skyjake committed Feb 5, 2016
1 parent 04a2412 commit 6bd891a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion doomsday/sdk/libcore/include/de/filesys/directoryfeed.h
Expand Up @@ -60,6 +60,8 @@ class DENG2_PUBLIC DirectoryFeed : public Feed
PopulateNativeSubfolders = 0x4,

OnlyThisFolder = 0,

DefaultFlags = PopulateNativeSubfolders
};
Q_DECLARE_FLAGS(Flags, Flag)

Expand All @@ -71,7 +73,7 @@ class DENG2_PUBLIC DirectoryFeed : public Feed
* @param mode Feed mode.
*/
DirectoryFeed(NativePath const &nativePath,
Flags const &mode = PopulateNativeSubfolders);
Flags const &mode = DefaultFlags);

virtual ~DirectoryFeed();

Expand Down
2 changes: 1 addition & 1 deletion doomsday/sdk/libcore/src/core/app.cpp
Expand Up @@ -217,7 +217,7 @@ DENG2_PIMPL(App)

// User's home folder.
fs.makeFolder("/home", FS::DontInheritFeeds).attach(new DirectoryFeed(self.nativeHomePath(),
DirectoryFeed::AllowWrite | DirectoryFeed::CreateIfMissing));
DirectoryFeed::AllowWrite | DirectoryFeed::CreateIfMissing | DirectoryFeed::DefaultFlags));

fs.makeFolder("/packs").attach(new PackageFeed(packageLoader));

Expand Down
1 change: 0 additions & 1 deletion doomsday/sdk/libcore/src/filesys/filesystem.cpp
Expand Up @@ -19,7 +19,6 @@

#include "de/FS"
#include "de/LibraryFile"
#include "de/DirectoryFeed"
#include "de/ArchiveFeed"
#include "de/NativePath"
#include "de/ArchiveFolder"
Expand Down
9 changes: 6 additions & 3 deletions doomsday/sdk/libcore/src/filesys/packageloader.cpp
Expand Up @@ -447,9 +447,12 @@ void PackageLoader::loadFromCommandLine()
StringList PackageLoader::findAllPackages() const
{
StringList all;
d->listPackagesInIndex(App::fileSystem().indexFor(DENG2_TYPE_NAME(Folder)), all);
d->listPackagesInIndex(App::fileSystem().indexFor(DENG2_TYPE_NAME(ArchiveFolder)), all);
d->listPackagesInIndex(App::fileSystem().indexFor(DENG2_TYPE_NAME(LinkFile)), all);
for(QString typeName : QStringList({ DENG2_TYPE_NAME(Folder),
DENG2_TYPE_NAME(ArchiveFolder),
DENG2_TYPE_NAME(LinkFile) }))
{
d->listPackagesInIndex(App::fileSystem().indexFor(typeName), all);
}
return all;
}

Expand Down

0 comments on commit 6bd891a

Please sign in to comment.