Mercurial > audlegacy
comparison src/audacious/playlist.c @ 3383:e2e875f3d02b trunk
Make playlist_load_ins handle the case when playlist is not the currently active one
author | Kieran Clancy <clancy.kieran+audacious@gmail.com> |
---|---|
date | Sun, 26 Aug 2007 07:23:52 +0930 |
parents | 880eea081363 |
children | ae30eb582a66 |
comparison
equal
deleted
inserted
replaced
3382:880eea081363 | 3383:e2e875f3d02b |
---|---|
1737 | 1737 |
1738 static guint | 1738 static guint |
1739 playlist_load_ins(Playlist * playlist, const gchar * filename, gint pos) | 1739 playlist_load_ins(Playlist * playlist, const gchar * filename, gint pos) |
1740 { | 1740 { |
1741 PlaylistContainer *plc; | 1741 PlaylistContainer *plc; |
1742 GList *old_iter; | |
1742 gchar *ext; | 1743 gchar *ext; |
1743 gint old_len, new_len; | 1744 gint old_len, new_len; |
1744 | 1745 |
1745 g_return_val_if_fail(playlist != NULL, 0); | 1746 g_return_val_if_fail(playlist != NULL, 0); |
1746 g_return_val_if_fail(filename != NULL, 0); | 1747 g_return_val_if_fail(filename != NULL, 0); |
1750 | 1751 |
1751 g_return_val_if_fail(plc != NULL, 0); | 1752 g_return_val_if_fail(plc != NULL, 0); |
1752 g_return_val_if_fail(plc->plc_read != NULL, 0); | 1753 g_return_val_if_fail(plc->plc_read != NULL, 0); |
1753 | 1754 |
1754 old_len = playlist_get_length(playlist); | 1755 old_len = playlist_get_length(playlist); |
1755 plc->plc_read(filename, pos); | 1756 /* make sure it adds files to the right playlist */ |
1757 if (playlist != playlist_get_active()) { | |
1758 old_iter = playlists_iter; | |
1759 playlists_iter = g_list_find(playlists, playlist); | |
1760 if (!playlists_iter) playlists_iter = playlists; | |
1761 plc->plc_read(filename, pos); | |
1762 playlists_iter = old_iter; | |
1763 } else { | |
1764 plc->plc_read(filename, pos); | |
1765 } | |
1756 new_len = playlist_get_length(playlist); | 1766 new_len = playlist_get_length(playlist); |
1757 | 1767 |
1758 playlist_generate_shuffle_list(playlist); | 1768 playlist_generate_shuffle_list(playlist); |
1759 playlistwin_update_list(playlist); | 1769 playlistwin_update_list(playlist); |
1760 | 1770 |