# HG changeset patch # User giacomo # Date 1167431589 28800 # Node ID e7ecc79293c86832faea0061d8ab0892587c9616 # Parent b4d874d3d9ff97057b0e837c805100f8f1968d82 [svn] - deletion of the last playlist is now handled directly in playlist_remove_playlist (patch by Joker) ; small code changes in playlist manager diff -r b4d874d3d9ff -r e7ecc79293c8 ChangeLog --- a/ChangeLog Fri Dec 29 09:59:21 2006 -0800 +++ b/ChangeLog Fri Dec 29 14:33:09 2006 -0800 @@ -1,3 +1,11 @@ +2006-12-29 17:59:21 +0000 Yoshiki Yazawa + revision [3445] + - fix a typo that kustodian pointed out. (probably it's mine.) + + trunk/audacious/glade/prefswin.glade | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + + 2006-12-29 14:14:57 +0000 Kiyoshi Aman revision [3443] Add Serbian Latin & Cyrillic translations courtesy of external translator Strahinja Kustudi?\196?\135 diff -r b4d874d3d9ff -r e7ecc79293c8 audacious/playlist.c --- a/audacious/playlist.c Fri Dec 29 09:59:21 2006 -0800 +++ b/audacious/playlist.c Fri Dec 29 14:33:09 2006 -0800 @@ -250,6 +250,16 @@ void playlist_remove_playlist(Playlist *playlist) { + /* trying to free the last playlist simply clears and resets it */ + if (g_list_length(playlists) < 2) { + playlist_clear(playlist); + playlist_set_current_name(playlist, NULL); + return; + } + + if (playlist == playlist_get_active()) + playlist_select_next(); + /* upon removal, a playlist should be cleared and freed */ playlists = g_list_remove(playlists, playlist); playlist_clear(playlist); diff -r b4d874d3d9ff -r e7ecc79293c8 audacious/playlist_manager.c --- a/audacious/playlist_manager.c Fri Dec 29 09:59:21 2006 -0800 +++ b/audacious/playlist_manager.c Fri Dec 29 14:33:09 2006 -0800 @@ -120,19 +120,19 @@ gtk_tree_model_get( store, &iter, PLLIST_COL_PLPOINTER , &playlist , -1 ); if ( gtk_tree_model_iter_n_children( store , NULL ) < 2 ) - return; /* do not delete the last playlist available */ - - gtk_list_store_remove( (GtkListStore*)store , &iter ); - - /* if the playlist removed is the active one, switch to the next */ - if ( playlist == playlist_get_active() ) - playlist_select_next(); - - /* this ensures that playlist_manager_update() will - not perform update, since we're already doing it here */ - DISABLE_MANAGER_UPDATE(); - playlist_remove_playlist( playlist ); - ENABLE_MANAGER_UPDATE(); + { + /* let playlist_manager_update() handle the deletion of the last playlist */ + playlist_remove_playlist( playlist ); + } + else + { + gtk_list_store_remove( (GtkListStore*)store , &iter ); + /* this ensures that playlist_manager_update() will + not perform update, since we're already doing it here */ + DISABLE_MANAGER_UPDATE(); + playlist_remove_playlist( playlist ); + ENABLE_MANAGER_UPDATE(); + } } return;