summaryrefslogtreecommitdiff
path: root/search.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-08-09 16:21:07 +0200
committerGravatar waker <wakeroid@gmail.com>2009-08-09 16:21:07 +0200
commit5d3d436d2e5c825c1c39931479dd19f533573963 (patch)
treea2da5fe45c29ac441b3d639c9f56789de60f1b30 /search.c
parent2d520c4c86d0cc67450a7a24a3f2ffba7447cf7e (diff)
huge playlist refactoring, optimized shuffle, several bugfixes
Diffstat (limited to 'search.c')
-rw-r--r--search.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/search.c b/search.c
index 59611d4a..6c2cafcf 100644
--- a/search.c
+++ b/search.c
@@ -33,7 +33,6 @@
#include "gtkplaylist.h"
GtkWidget *searchwin = NULL;
-struct playItem_s *search_head = NULL;
struct playItem_s *search_current = NULL;
int search_count = 0;
@@ -61,21 +60,21 @@ on_searchentry_changed (GtkEditable *editable,
const gchar *text = gtk_entry_get_text (GTK_ENTRY (editable));
- search_head = NULL;
- playItem_t *tail = NULL;
+ playlist_head[PS_SEARCH] = NULL;
+ playlist_tail[PS_SEARCH] = NULL;
search_count = 0;
if (*text) {
- for (playItem_t *it = playlist_head; it; it = it->next[PS_NEXT]) {
+ for (playItem_t *it = playlist_head[PS_MAIN]; it; it = it->next[PS_MAIN]) {
for (metaInfo_t *m = it->meta; m; m = m->next) {
if (strcasestr (m->value, text)) {
// add to list
- it->next[PS_SEARCH_NEXT] = NULL;
- if (tail) {
- tail->next[PS_SEARCH_NEXT] = it;
- tail = it;
+ it->next[PS_SEARCH] = NULL;
+ if (playlist_tail[PS_SEARCH]) {
+ playlist_tail[PS_SEARCH]->next[PS_SEARCH] = it;
+ playlist_tail[PS_SEARCH] = it;
}
else {
- search_head = tail = it;
+ playlist_head[PS_SEARCH] = playlist_tail[PS_SEARCH] = it;
}
search_count++;
break;