summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-28 21:57:29 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2009-12-28 21:57:29 +0100
commit0a230ab204c7e3372ebd53bf79e7ca518a515838 (patch)
treec88952be8277877b7b50e42f2c63c53e65c635f7 /playlist.c
parent7e4e9c4373b075ad161b0b0ef65617cd01d935b7 (diff)
reset selection on empty search query
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/playlist.c b/playlist.c
index a3d0bde9..2517d84a 100644
--- a/playlist.c
+++ b/playlist.c
@@ -1897,6 +1897,7 @@ void
pl_search_reset (void) {
while (playlist_head[PL_SEARCH]) {
playItem_t *next = playlist_head[PL_SEARCH]->next[PL_SEARCH];
+ playlist_head[PL_SEARCH]->selected = 0;
playlist_head[PL_SEARCH]->next[PL_SEARCH] = NULL;
playlist_head[PL_SEARCH]->prev[PL_SEARCH] = NULL;
playlist_head[PL_SEARCH] = next;
@@ -1908,11 +1909,11 @@ pl_search_reset (void) {
void
pl_search_process (const char *text) {
pl_search_reset ();
- if (*text) {
- for (playItem_t *it = playlist_head[PL_MAIN]; it; it = it->next[PL_MAIN]) {
- it->selected = 0;
+ for (playItem_t *it = playlist_head[PL_MAIN]; it; it = it->next[PL_MAIN]) {
+ it->selected = 0;
+ if (*text) {
for (metaInfo_t *m = it->meta; m; m = m->next) {
-// if (strcasestr (m->value, text)) {
+ // if (strcasestr (m->value, text)) {
if (utfcasestr (m->value, text)) {
// add to list
it->next[PL_SEARCH] = NULL;
@@ -1928,8 +1929,8 @@ pl_search_process (const char *text) {
break;
}
}
+ }
}
- }
}
int