diff options
author | waker <wakeroid@gmail.com> | 2009-08-09 16:21:07 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2009-08-09 16:21:07 +0200 |
commit | 5d3d436d2e5c825c1c39931479dd19f533573963 (patch) | |
tree | a2da5fe45c29ac441b3d639c9f56789de60f1b30 /search.c | |
parent | 2d520c4c86d0cc67450a7a24a3f2ffba7447cf7e (diff) |
huge playlist refactoring, optimized shuffle, several bugfixes
Diffstat (limited to 'search.c')
-rw-r--r-- | search.c | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -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; |