[rhythmbox/v0.13.x] playlist-manager: ensure the play queue gets saved (bug #644585)



commit c26f38b33a00d781fa866e7ee725fd12e9068f01
Author: Jonathan Matthew <jonathan d14n org>
Date:   Wed Apr 6 19:16:56 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 c20292c..b5b5c61 100644
--- a/shell/rb-playlist-manager.c
+++ b/shell/rb-playlist-manager.c
@@ -916,7 +916,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;
 	}
 
@@ -950,6 +950,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 */
@@ -973,6 +974,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]