changeset 3476:9152829f3c19 trunk

Allow non-active playlist to be saved to file
author Kieran Clancy <clancy.kieran+audacious@gmail.com>
date Mon, 10 Sep 2007 13:47:16 +0930
parents 80cff88ad6d0
children 57f4971b7086
files src/audacious/playlist.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playlist.c	Mon Sep 10 13:46:37 2007 +0930
+++ b/src/audacious/playlist.c	Mon Sep 10 13:47:16 2007 +0930
@@ -1568,6 +1568,7 @@
 playlist_save(Playlist * playlist, const gchar * filename)
 {
     PlaylistContainer *plc = NULL;
+    GList *old_iter;
     gchar *ext;
 
     g_return_val_if_fail(playlist != NULL, FALSE);
@@ -1584,7 +1585,16 @@
     if (plc->plc_write == NULL)
         return FALSE;
 
-    plc->plc_write(filename, 0);
+    /* Save the right playlist to disk */
+    if (playlist != playlist_get_active()) {
+        old_iter = playlists_iter;
+        playlists_iter = g_list_find(playlists, playlist);
+        if(!playlists_iter) playlists_iter = old_iter;
+        plc->plc_write(filename, 0);
+        playlists_iter = old_iter;
+    } else {
+        plc->plc_write(filename, 0);
+    }
 
     return TRUE;
 }