totem r5848 - in trunk: . src



Author: hadess
Date: Wed Dec 10 23:38:11 2008
New Revision: 5848
URL: http://svn.gnome.org/viewvc/totem?rev=5848&view=rev

Log:
2008-12-10  Bastien Nocera  <hadess hadess net>

	* src/totem-playlist.c (playlist_remove_files): Remove
	dead code



Modified:
   trunk/ChangeLog
   trunk/src/totem-playlist.c

Modified: trunk/src/totem-playlist.c
==============================================================================
--- trunk/src/totem-playlist.c	(original)
+++ trunk/src/totem-playlist.c	Wed Dec 10 23:38:11 2008
@@ -883,109 +883,6 @@
 playlist_remove_files (TotemPlaylist *playlist)
 {
 	totem_playlist_clear_with_compare (playlist, NULL, NULL);
-#if 0
-	GtkTreeSelection *selection;
-	GtkTreeRowReference *ref;
-	gboolean is_selected = FALSE;
-	int next_pos;
-
-	selection = gtk_tree_view_get_selection
-		(GTK_TREE_VIEW (playlist->priv->treeview));
-	if (selection == NULL)
-		return;
-
-	gtk_tree_selection_selected_foreach (selection,
-			totem_playlist_foreach_selected,
-			(gpointer) playlist);
-
-	/* If the current item is to change, we need to keep an static
-	 * reference to it, TreeIter and TreePath don't allow that */
-	if (playlist->priv->current != NULL)
-	{
-		int *indices;
-
-		ref = gtk_tree_row_reference_new (playlist->priv->model,
-				playlist->priv->current);
-		is_selected = gtk_tree_selection_path_is_selected (selection,
-				playlist->priv->current);
-
-		indices = gtk_tree_path_get_indices (playlist->priv->current);
-		next_pos = indices[0];
-
-		gtk_tree_path_free (playlist->priv->current);
-	} else {
-		ref = NULL;
-		next_pos = -1;
-	}
-
-	/* We destroy the items, one-by-one from the list built above */
-	while (playlist->priv->list != NULL)
-	{
-		GtkTreePath *path;
-		GtkTreeIter iter;
-
-		path = gtk_tree_row_reference_get_path
-			((GtkTreeRowReference *)(playlist->priv->list->data));
-		gtk_tree_model_get_iter (playlist->priv->model, &iter, path);
-		gtk_tree_path_free (path);
-
-		totem_playlist_emit_item_removed (playlist, &iter);
-		gtk_list_store_remove (GTK_LIST_STORE (playlist->priv->model), &iter);
-
-		gtk_tree_row_reference_free
-			((GtkTreeRowReference *)(playlist->priv->list->data));
-		playlist->priv->list = g_list_remove (playlist->priv->list,
-				playlist->priv->list->data);
-	}
-	g_list_free (playlist->priv->list);
-	playlist->priv->list = NULL;
-
-	if (is_selected != FALSE) {
-		/* The current item was removed from the playlist */
-		if (next_pos != -1) {
-			char *str;
-			GtkTreeIter iter;
-			GtkTreePath *cur;
-
-			str = g_strdup_printf ("%d", next_pos);
-			cur = gtk_tree_path_new_from_string (str);
-
-			if (gtk_tree_model_get_iter (playlist->priv->model,
-						&iter, cur) == FALSE)
-			{
-				playlist->priv->current = NULL;
-				gtk_tree_path_free (cur);
-			} else {
-				playlist->priv->current = cur;
-			}
-			g_free (str);
-		} else {
-			playlist->priv->current = NULL;
-		}
-
-		playlist->priv->current_shuffled = -1;
-		ensure_shuffled (playlist, playlist->priv->shuffle);
-
-		g_signal_emit (G_OBJECT (playlist),
-				totem_playlist_table_signals[CURRENT_REMOVED],
-				0, NULL);
-	} else {
-		if (ref != NULL) {
-			/* The path to the current item changed */
-			playlist->priv->current =
-				gtk_tree_row_reference_get_path (ref);
-			gtk_tree_row_reference_free (ref);
-		}
-
-		ensure_shuffled (playlist, playlist->priv->shuffle);
-
-		g_signal_emit (G_OBJECT (playlist),
-				totem_playlist_table_signals[CHANGED], 0,
-				NULL);
-	}
-	totem_playlist_update_save_button (playlist);
-	gtk_tree_view_columns_autosize (GTK_TREE_VIEW (playlist->priv->treeview));
-#endif
 }
 
 void



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