mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-15 18:58:55 +01:00
parent
645b819b68
commit
2e71390acd
@ -111,11 +111,11 @@ bool LibraryBackend::Like(const char* needle, const char* haystack) {
|
|||||||
}
|
}
|
||||||
QString b = QString::fromUtf8(haystack);
|
QString b = QString::fromUtf8(haystack);
|
||||||
foreach (const QString& query, query_cache_) {
|
foreach (const QString& query, query_cache_) {
|
||||||
if (b.contains(query, Qt::CaseInsensitive)) {
|
if (!b.contains(query, Qt::CaseInsensitive)) {
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Custom LIKE(X, Y) function for sqlite3 that supports case insensitive unicode matching.
|
// Custom LIKE(X, Y) function for sqlite3 that supports case insensitive unicode matching.
|
||||||
|
@ -224,8 +224,8 @@ TEST_F(LibraryBackendTest, LikeCacheInvalidated) {
|
|||||||
|
|
||||||
TEST_F(LibraryBackendTest, LikeQuerySplit) {
|
TEST_F(LibraryBackendTest, LikeQuerySplit) {
|
||||||
EXPECT_TRUE(backend_->Like("%foo bar%", "foobar"));
|
EXPECT_TRUE(backend_->Like("%foo bar%", "foobar"));
|
||||||
EXPECT_TRUE(backend_->Like("%foo bar%", "barbaz"));
|
EXPECT_FALSE(backend_->Like("%foo bar%", "barbaz"));
|
||||||
EXPECT_TRUE(backend_->Like("%foo bar%", "foobaz"));
|
EXPECT_FALSE(backend_->Like("%foo bar%", "foobaz"));
|
||||||
EXPECT_FALSE(backend_->Like("%foo bar%", "baz"));
|
EXPECT_FALSE(backend_->Like("%foo bar%", "baz"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user