diff options
author | Michał Cichoń <michcic@gmail.com> | 2017-05-17 04:07:07 +0200 |
---|---|---|
committer | Michał Cichoń <michcic@gmail.com> | 2017-05-17 04:37:39 +0200 |
commit | 817ff6a87020a55d7628d600e2ee09b947ee2f4e (patch) | |
tree | be90eee756de623bccfd3c4cd603c71ec6f0ac2f /src/ui_act.c | |
parent | 7c4b615a38a49e1bbe9c2315fed09920aa238b65 (diff) | |
download | pianobar-windows-817ff6a87020a55d7628d600e2ee09b947ee2f4e.tar.gz pianobar-windows-817ff6a87020a55d7628d600e2ee09b947ee2f4e.tar.bz2 pianobar-windows-817ff6a87020a55d7628d600e2ee09b947ee2f4e.zip |
Show status code text if no other source of error is available.
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ui_act.c b/src/ui_act.c index 4206a33..cb1d7a8 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -224,10 +224,14 @@ BarUiActCallback(BarUiActDeleteStation) { if (BarUiActDefaultPianoCall (PIANO_REQUEST_DELETE_STATION, selStation) && selStation == app->curStation) { BarUiDoSkipSong (app->player); - PianoDestroyPlaylist (PianoListNextP (app->playlist)); - app->playlist->head.next = NULL; - BarUiHistoryPrepend (app, app->playlist); - app->playlist = NULL; + if (app->playlist != NULL) { + /* drain playlist */ + PianoDestroyPlaylist (PianoListNextP (app->playlist)); + app->playlist->head.next = NULL; + } + app->nextStation = NULL; + /* XXX: usually we shoudn’t touch cur*, but DELETE_STATION destroys + * station struct */ app->curStation = NULL; } BarUiActDefaultEventcmd ("stationdelete"); @@ -446,14 +450,12 @@ BarUiActCallback(BarUiActSelectStation) { PianoStation_t *newStation = BarUiSelectStation (app, app->ph.stations, "Select station: ", NULL, app->settings.autoselect); if (newStation != NULL) { - app->curStation = newStation; - BarUiPrintStation (&app->settings, app->curStation); + app->nextStation = newStation; BarUiDoSkipSong (app->player); if (app->playlist != NULL) { + /* drain playlist */ PianoDestroyPlaylist (PianoListNextP (app->playlist)); app->playlist->head.next = NULL; - BarUiHistoryPrepend (app, app->playlist); - app->playlist = NULL; } } } |