[totem] main: Fix drag'n'drop ordering on the playlist



commit 1fde879b302bf3a98ea1d2dec11d63b4c8662688
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jul 13 15:46:24 2012 +0100

    main: Fix drag'n'drop ordering on the playlist
    
    Since made the processing of playlists asynchronous, adding files
    to the playlist didn't insert them at the position we told them to,
    because the ->tree_path used to check where to insert it was freed
    before we had any chance to process the added MRLs.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=663951

 src/totem-playlist.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index d3bb120..f858617 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -480,6 +480,8 @@ drop_finished_cb (TotemPlaylist *playlist, GAsyncResult *result, gpointer user_d
 {
 	totem_playlist_add_mrls_finish (playlist, result, NULL);
 
+	g_clear_pointer (&playlist->priv->tree_path, gtk_tree_path_free);
+
 	/* Emit the "changed" signal once the last dropped MRL has been added to the playlist */
 	g_signal_emit (G_OBJECT (playlist),
 	               totem_playlist_table_signals[CHANGED], 0,
@@ -574,8 +576,6 @@ drop_cb (GtkWidget        *widget,
 	g_strfreev (list);
 	g_list_free (file_list);
 	gtk_drag_finish (context, TRUE, FALSE, _time);
-	gtk_tree_path_free (playlist->priv->tree_path);
-	playlist->priv->tree_path = NULL;
 }
 
 void
@@ -1636,6 +1636,8 @@ totem_playlist_finalize (GObject *object)
 	if (playlist->priv->current != NULL)
 		gtk_tree_path_free (playlist->priv->current);
 
+	g_clear_pointer (&playlist->priv->tree_path, gtk_tree_path_free);
+
 	G_OBJECT_CLASS (totem_playlist_parent_class)->finalize (object);
 }
 



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