[totem] Pass a URI to totem_add_subtitle()



commit 0992cff4ccdc6c9eaedcb7f0583e8a91a26c5900
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Sep 2 18:10:08 2009 +0100

    Pass a URI to totem_add_subtitle()
    
    And don't use the filename to get it, because it doesn't have
    any path information whatsoever...

 src/totem-playlist.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/totem-playlist.c b/src/totem-playlist.c
index 0269f54..9ae3d29 100644
--- a/src/totem-playlist.c
+++ b/src/totem-playlist.c
@@ -261,7 +261,7 @@ totem_playlist_error (char *title, char *reason, TotemPlaylist *playlist)
 void
 totem_playlist_select_subtitle_dialog(TotemPlaylist *playlist, TotemPlaylistSelectDialog mode)
 {
-	char *subtitle, *current, *path;
+	char *subtitle, *current, *uri;
 	GFile *file, *dir;
 	TotemPlaylistStatus playing;
 	GtkTreeIter iter;
@@ -283,23 +283,23 @@ totem_playlist_select_subtitle_dialog(TotemPlaylist *playlist, TotemPlaylistSele
 
 	/* Look for the directory of the current movie */
 	gtk_tree_model_get (playlist->priv->model, &iter,
-			    FILENAME_COL, &current,
+			    URI_COL, &current,
 			    -1);
 
 	if (current == NULL)
 		return;
 
-	path = NULL;
-	file = g_file_new_for_commandline_arg (current);
+	uri = NULL;
+	file = g_file_new_for_uri (current);
 	dir = g_file_get_parent (file);
 	g_object_unref (file);
 	if (dir != NULL) {
-		path = g_file_get_path (dir);
+		uri = g_file_get_uri (dir);
 		g_object_unref (dir);
 	}
 
-	subtitle = totem_add_subtitle (totem_playlist_get_toplevel (playlist), path);
-	g_free (path);
+	subtitle = totem_add_subtitle (totem_playlist_get_toplevel (playlist), uri);
+	g_free (uri);
 
 	if (subtitle == NULL)
 		return;



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