[totem] Pass the base URI from the plugin to the viewer



commit c59b48103c1dc00bc1926c3c3a1cd7089d2bd57e
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 20 17:04:05 2009 +0000

    Pass the base URI from the plugin to the viewer
    
    When using AddItem(). Makes the subtitle handling test case
    for OLPC work.

 browser-plugin/org_gnome_totem_PluginViewer.xml |    1 +
 browser-plugin/totem-plugin-viewer.c            |    3 ++-
 browser-plugin/totemPlugin.cpp                  |   10 ++++------
 3 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/browser-plugin/org_gnome_totem_PluginViewer.xml b/browser-plugin/org_gnome_totem_PluginViewer.xml
index e704df6..efe9730 100644
--- a/browser-plugin/org_gnome_totem_PluginViewer.xml
+++ b/browser-plugin/org_gnome_totem_PluginViewer.xml
@@ -51,6 +51,7 @@
     </method>
     <method name="ClearPlaylist" />
     <method name="AddItem">
+      <arg type="s" name="BaseURI" direction="in" />
       <arg type="s" name="URI" direction="in" />
       <arg type="s" name="Title" direction="in" />
       <arg type="s" name="Subtitle" direction="in" />
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index d6d9d20..32e45ad 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -707,6 +707,7 @@ totem_embedded_clear_playlist (TotemEmbedded *emb, GError *error)
 
 static gboolean
 totem_embedded_add_item (TotemEmbedded *embedded,
+			 const char *base_uri,
 			 const char *uri,
 			 const char *title,
 			 const char *subtitle,
@@ -730,7 +731,7 @@ totem_embedded_add_item (TotemEmbedded *embedded,
 		embedded->current = embedded->playlist;
 		totem_embedded_set_uri (embedded,
 					(const char *) uri,
-					embedded->base_uri /* FIXME? */,
+					base_uri,
 					subtitle,
 					FALSE);
 		totem_embedded_open_internal (embedded, FALSE, NULL /* FIXME */);
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index ca99ea9..c0d6357 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -345,8 +345,6 @@ totemPlugin::AddItem (const NPString& aURI,
         if (!aURI.UTF8Characters || !aURI.UTF8Length)
                 return -1;
 
-        /* FIXMEchpe: resolve against mBaseURI or mSrcURI ?? */
-
         char *uri = g_strndup (aURI.UTF8Characters, aURI.UTF8Length);
 
 	char *title;
@@ -355,8 +353,6 @@ totemPlugin::AddItem (const NPString& aURI,
 	else
 		title = NULL;
 
-	/* FIXME: resolve the subtitle URI against the URI itself */
-
 	if (!mViewerReady) {
 		D ("Queuing AddItem '%s' (title: '%s' sub: '%s')",
 		   uri, title ? title : "", aSubtitle ? aSubtitle : "");
@@ -377,6 +373,7 @@ totemPlugin::AddItem (const NPString& aURI,
 
         dbus_g_proxy_call_no_reply (mViewerProxy,
 				    "AddItem",
+				    G_TYPE_STRING, mBaseURI,
 				    G_TYPE_STRING, uri,
 				    G_TYPE_STRING, title,
 				    G_TYPE_STRING, aSubtitle,
@@ -812,12 +809,13 @@ totemPlugin::ViewerReady ()
 		case TOTEM_QUEUE_TYPE_ADD_ITEM:
 			assert (mViewerProxy);
 
-			D ("AddItem '%s' (title: '%s' sub: '%s')",
-			   cmd->add_item.uri,
+			D ("AddItem '%s' (base: '%s' title: '%s' sub: '%s')",
+			   cmd->add_item.uri, mBaseURI,
 			   cmd->add_item.title ? cmd->add_item.title : "",
 			   cmd->add_item.subtitle ? cmd->add_item.subtitle : "");
 			dbus_g_proxy_call_no_reply (mViewerProxy,
 						    "AddItem",
+						    G_TYPE_STRING, mBaseURI,
 						    G_TYPE_STRING, cmd->add_item.uri,
 						    G_TYPE_STRING, cmd->add_item.title,
 						    G_TYPE_STRING, cmd->add_item.subtitle,



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