[rhythmbox] playlist-manager: ensure the play queue gets saved (bug #644585)



commit cd51a148666010e086cdc521123bb7e769a2f939
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Apr 6 19:13:26 2011 +1000

    playlist-manager: ensure the play queue gets saved (bug #644585)
    
    When displayed as a side pane, the play queue is hidden from the display
    page tree.  Rather than relying on iterating the page tree to save it,
    save it separately.

 shell/rb-playlist-manager.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/shell/rb-playlist-manager.c b/shell/rb-playlist-manager.c
index acb3daa..1a7fef2 100644
--- a/shell/rb-playlist-manager.c
+++ b/shell/rb-playlist-manager.c
@@ -578,7 +578,7 @@ save_playlist_cb (GtkTreeModel *model,
 	if (page == NULL) {
 		goto out;
 	}
-	if (RB_IS_PLAYLIST_SOURCE (page) == FALSE) {
+	if (RB_IS_PLAYLIST_SOURCE (page) == FALSE || RB_IS_PLAY_QUEUE_SOURCE (page)) {
 		goto out;
 	}
 
@@ -612,6 +612,7 @@ rb_playlist_manager_save_playlists (RBPlaylistManager *mgr, gboolean force)
 {
 	xmlNodePtr root;
 	struct RBPlaylistManagerSaveData *data;
+	RBSource *queue_source;
 
 	if (!force && !rb_playlist_manager_is_dirty (mgr)) {
 		/* playlists already in sync, so don't bother */
@@ -635,6 +636,11 @@ rb_playlist_manager_save_playlists (RBPlaylistManager *mgr, gboolean force)
 				(GtkTreeModelForeachFunc)save_playlist_cb,
 				root);
 
+	/* also save the play queue */
+	g_object_get (mgr->priv->shell, "queue-source", &queue_source, NULL);
+	rb_playlist_source_save_to_xml (RB_PLAYLIST_SOURCE (queue_source), root);
+	g_object_unref (queue_source);
+
 	/* mark clean here.  if the save fails, we'll mark it dirty again */
 	rb_playlist_manager_set_dirty (data->mgr, FALSE);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]