Collection: Make sure RunQuery does not access collection items

- Rename `QueryOptions` to `CollectionFilterOptions`.
- Create new class `CollectionQueryOptions` for passing options from model to `CollectionQuery`.
- Rename `Directory` to `CollectionDirectory`.

Fixes #1095
This commit is contained in:
Jonas Kvinge
2023-01-08 15:40:54 +01:00
parent 41f2710dea
commit b5fa401db9
26 changed files with 620 additions and 459 deletions

View File

@@ -83,7 +83,7 @@ TEST_F(CollectionBackendTest, AddDirectory) {
// Check the signal was emitted correctly
ASSERT_EQ(1, spy.count());
Directory dir = spy[0][0].value<Directory>();
CollectionDirectory dir = spy[0][0].value<Directory>();
EXPECT_EQ(QFileInfo("/tmp").canonicalFilePath(), dir.path);
EXPECT_EQ(1, dir.id);
EXPECT_EQ(0, spy[0][1].value<SubdirectoryList>().size());
@@ -93,7 +93,7 @@ TEST_F(CollectionBackendTest, AddDirectory) {
TEST_F(CollectionBackendTest, RemoveDirectory) {
// Add a directory
Directory dir;
CollectionDirectory dir;
dir.id = 1;
dir.path = "/tmp";
backend_->AddDirectory(dir.path);