diff options
author | Max Kellermann <max@duempel.org> | 2008-09-18 01:55:45 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-09-18 01:55:45 +0200 |
commit | fe8895120e565f83f18fb3c0af7a0bbbc881e5d9 (patch) | |
tree | 61b2c130865a9f0bbeb43761a95596e9e4561dc8 | |
parent | f0aa88e5c18de0b1e4f5d85dd5c3ae5d9be76bc3 (diff) | |
download | mpd-fe8895120e565f83f18fb3c0af7a0bbbc881e5d9.tar.gz mpd-fe8895120e565f83f18fb3c0af7a0bbbc881e5d9.tar.xz mpd-fe8895120e565f83f18fb3c0af7a0bbbc881e5d9.zip |
playlist: removed "updated" flag
The caller may check the playlist.id instead of checking the old
"updated" flag.
-rw-r--r-- | src/mpdclient.c | 2 | ||||
-rw-r--r-- | src/playlist.c | 1 | ||||
-rw-r--r-- | src/playlist.h | 3 | ||||
-rw-r--r-- | src/screen_play.c | 5 |
4 files changed, 3 insertions, 8 deletions
diff --git a/src/mpdclient.c b/src/mpdclient.c index 469c794c6..1b5486616 100644 --- a/src/mpdclient.c +++ b/src/mpdclient.c @@ -666,7 +666,6 @@ mpdclient_playlist_update(mpdclient_t *c) c->playlist.id = c->status->playlist; c->song = NULL; - c->playlist.updated = TRUE; /* call playlist updated callbacks */ mpdclient_playlist_callback(c, PLAYLIST_EVENT_UPDATED, NULL); @@ -718,7 +717,6 @@ mpdclient_playlist_update_changes(mpdclient_t *c) c->song = NULL; c->playlist.id = c->status->playlist; - c->playlist.updated = TRUE; mpdclient_playlist_callback(c, PLAYLIST_EVENT_UPDATED, NULL); diff --git a/src/playlist.c b/src/playlist.c index 6751e5dad..76a448ba2 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -33,7 +33,6 @@ void playlist_init(struct mpdclient_playlist *playlist) { playlist->id = 0; - playlist->updated = FALSE; playlist->list = g_ptr_array_sized_new(1024); } diff --git a/src/playlist.h b/src/playlist.h index 93c034f5a..0d524adbe 100644 --- a/src/playlist.h +++ b/src/playlist.h @@ -33,9 +33,6 @@ typedef struct mpdclient_playlist { /* playlist id */ long long id; - /* true if the list is updated */ - gboolean updated; - /* the list */ GPtrArray *list; } mpdclient_playlist_t; diff --git a/src/screen_play.c b/src/screen_play.c index c89d150cf..cd43982c3 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -51,6 +51,7 @@ typedef struct } completion_callback_data_t; static list_window_t *lw = NULL; +static long long playlist_id; static void playlist_changed_callback(mpdclient_t *c, int event, gpointer data) @@ -398,14 +399,14 @@ play_update(screen_t *screen, mpdclient_t *c) } } - if( c->playlist.updated ) { + if (c->playlist.id != playlist_id) { if (lw->selected >= c->playlist.list->len) lw->selected = c->playlist.list->len - 1; if (lw->start >= c->playlist.list->len) list_window_reset(lw); play_paint(screen, c); - c->playlist.updated = FALSE; + playlist_id = c->playlist.id; } else if( lw->repaint || 1) { list_window_paint(lw, list_callback, (void *) c); wnoutrefresh(lw->w); |