1
0
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:
John Maguire 2010-03-26 15:04:38 +00:00
parent 1cad21a3e0
commit 2afd94ce47
2 changed files with 5 additions and 4 deletions

View File

@ -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() {

View File

@ -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));
} }