mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-31 11:35:24 +01:00
Switch cover manager filter from OR to AND.
This commit is contained in:
parent
1cad21a3e0
commit
2afd94ce47
@ -260,12 +260,12 @@ bool AlbumCoverManager::ShouldHide(
|
|||||||
|
|
||||||
QStringList query = filter.split(' ');
|
QStringList query = filter.split(' ');
|
||||||
foreach (const QString& s, query) {
|
foreach (const QString& s, query) {
|
||||||
if (item.text().contains(s, Qt::CaseInsensitive)) {
|
if (!item.text().contains(s, Qt::CaseInsensitive)) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlbumCoverManager::FetchAlbumCovers() {
|
void AlbumCoverManager::FetchAlbumCovers() {
|
||||||
|
@ -38,5 +38,6 @@ TEST_F(AlbumCoverManagerTest, HidesItemsWithFilter) {
|
|||||||
QListWidgetItem shown_item;
|
QListWidgetItem shown_item;
|
||||||
shown_item.setText("foobar");
|
shown_item.setText("foobar");
|
||||||
EXPECT_FALSE(manager_.ShouldHide(shown_item, "foo", AlbumCoverManager::Hide_None));
|
EXPECT_FALSE(manager_.ShouldHide(shown_item, "foo", AlbumCoverManager::Hide_None));
|
||||||
EXPECT_FALSE(manager_.ShouldHide(shown_item, "abc bar", AlbumCoverManager::Hide_None));
|
EXPECT_TRUE(manager_.ShouldHide(shown_item, "abc bar", AlbumCoverManager::Hide_None));
|
||||||
|
EXPECT_FALSE(manager_.ShouldHide(shown_item, "bar foo", AlbumCoverManager::Hide_None));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user