diff options
author | Michał Cichoń <michcic@gmail.com> | 2017-05-18 18:25:59 +0200 |
---|---|---|
committer | Michał Cichoń <michcic@gmail.com> | 2017-05-18 18:25:59 +0200 |
commit | cd5c65097ecf03480f477e47e0bb706dbf705a21 (patch) | |
tree | 21f4419d9dceae3226286585b8b5ca87ea1934ce /src/ui_act.c | |
parent | 6dee813dad2dd0b741025be046dfe3c7019bddb9 (diff) | |
parent | 593b2d6f18eb21309b82f7cad4a56f7bb1218180 (diff) | |
download | pianobar-windows-cd5c65097ecf03480f477e47e0bb706dbf705a21.tar.gz pianobar-windows-cd5c65097ecf03480f477e47e0bb706dbf705a21.tar.bz2 pianobar-windows-cd5c65097ecf03480f477e47e0bb706dbf705a21.zip |
Merge branch 'release/2017.05.18'2017.05.18
Diffstat (limited to 'src/ui_act.c')
-rw-r--r-- | src/ui_act.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/ui_act.c b/src/ui_act.c index 4206a33..a036f19 100644 --- a/src/ui_act.c +++ b/src/ui_act.c @@ -224,11 +224,17 @@ 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; + selSong = NULL; + } + app->nextStation = NULL; + /* XXX: usually we shoudn’t touch cur*, but DELETE_STATION destroys + * station struct */ app->curStation = NULL; + selStation = NULL; } BarUiActDefaultEventcmd ("stationdelete"); } @@ -446,14 +452,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; } } } |