clear search results if empty string is passed to FindForward/Backward
This commit is contained in:
@@ -271,6 +271,11 @@ bool Browser::allowsSearching()
|
|||||||
|
|
||||||
bool Browser::search(const std::string &constraint)
|
bool Browser::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
w.clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto fun = std::bind(BrowserEntryMatcher, _1, _2, false);
|
auto fun = std::bind(BrowserEntryMatcher, _1, _2, false);
|
||||||
|
|||||||
@@ -596,6 +596,16 @@ bool MediaLibrary::allowsSearching()
|
|||||||
|
|
||||||
bool MediaLibrary::search(const std::string &constraint)
|
bool MediaLibrary::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
if (isActiveWindow(Tags))
|
||||||
|
Tags.clearSearchResults();
|
||||||
|
else if (isActiveWindow(Albums))
|
||||||
|
Albums.clearSearchResults();
|
||||||
|
else if (isActiveWindow(Songs))
|
||||||
|
Songs.clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
@@ -161,6 +161,11 @@ bool Playlist::allowsSearching()
|
|||||||
|
|
||||||
bool Playlist::search(const std::string &constraint)
|
bool Playlist::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
w.clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto rx = RegexFilter<MPD::Song>(
|
auto rx = RegexFilter<MPD::Song>(
|
||||||
|
|||||||
@@ -364,6 +364,14 @@ bool PlaylistEditor::allowsSearching()
|
|||||||
|
|
||||||
bool PlaylistEditor::search(const std::string &constraint)
|
bool PlaylistEditor::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
if (isActiveWindow(Playlists))
|
||||||
|
Playlists.clearSearchResults();
|
||||||
|
else if (isActiveWindow(Content))
|
||||||
|
Content.clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
@@ -284,6 +284,11 @@ bool SearchEngine::allowsSearching()
|
|||||||
|
|
||||||
bool SearchEngine::search(const std::string &constraint)
|
bool SearchEngine::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
w.clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
auto fun = std::bind(SEItemEntryMatcher, _1, _2, false);
|
auto fun = std::bind(SEItemEntryMatcher, _1, _2, false);
|
||||||
|
|||||||
@@ -770,6 +770,14 @@ bool TagEditor::allowsSearching()
|
|||||||
|
|
||||||
bool TagEditor::search(const std::string &constraint)
|
bool TagEditor::search(const std::string &constraint)
|
||||||
{
|
{
|
||||||
|
if (constraint.empty())
|
||||||
|
{
|
||||||
|
if (w == Dirs)
|
||||||
|
Dirs->clearSearchResults();
|
||||||
|
else if (w == Tags)
|
||||||
|
Tags->clearSearchResults();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user