[totem/gnome-2-28] Add better debug



commit 405a1b9f7f17fd5679de826d93fabdea29b66515
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 21 20:30:05 2010 +0000

    Add better debug

 browser-plugin/totem-plugin-viewer.c |   21 +++++++++++++++++----
 browser-plugin/totemPlugin.cpp       |   11 ++++++++++-
 2 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/browser-plugin/totem-plugin-viewer.c b/browser-plugin/totem-plugin-viewer.c
index b56dc50..b8f1dc1 100644
--- a/browser-plugin/totem-plugin-viewer.c
+++ b/browser-plugin/totem-plugin-viewer.c
@@ -527,6 +527,8 @@ totem_embedded_do_command (TotemEmbedded *embedded,
 {
 	g_return_val_if_fail (command != NULL, FALSE);
 
+	g_message ("totem_embedded_do_command: %s", command);
+
 	if (strcmp (command, TOTEM_COMMAND_PLAY) == 0) {
 		return totem_embedded_play (embedded, error);
 	}
@@ -550,6 +552,9 @@ totem_embedded_set_href (TotemEmbedded *embedded,
 			 const char *target,
 			 GError *error)
 {
+	g_message ("totem_embedded_set_href %s (target: %s)",
+		   href_uri, target);
+
 	g_free (embedded->href_uri);
 	g_free (embedded->target);
 
@@ -683,6 +688,8 @@ totem_pl_item_free (gpointer data, gpointer user_data)
 static gboolean
 totem_embedded_clear_playlist (TotemEmbedded *emb, GError *error)
 {
+	g_message ("totem_embedded_clear_playlist");
+
 	g_list_foreach (emb->playlist, (GFunc) totem_pl_item_free, NULL);
 	g_list_free (emb->playlist);
 
@@ -703,7 +710,8 @@ totem_embedded_add_item (TotemEmbedded *embedded, const char *uri, GError *error
 {
 	TotemPlItem *item;
 
-	g_message ("totem_embedded_add_item: %s", uri);
+	g_message ("totem_embedded_add_item: %s (base: %s title: %s subtitle: %s)",
+		   uri, base_uri, title, subtitle);
 
 	item = g_new0 (TotemPlItem, 1);
 	item->uri = g_strdup (uri);
@@ -823,6 +831,8 @@ static gboolean
 totem_embedded_close_stream (TotemEmbedded *emb,
 			     GError *error)
 {
+	g_message ("totem_embedded_close_stream");
+
 	if (!emb->is_browser_stream)
 		return TRUE;
 
@@ -890,7 +900,8 @@ totem_embedded_set_local_file (TotemEmbedded *emb,
 {
 	char *file_uri;
 
-	g_message ("Setting the current path to %s", path);
+	g_message ("Setting the current path to %s (uri: %s base: %s)",
+		   path, uri, base_uri);
 
 	totem_embedded_clear_playlist (emb, NULL);
 
@@ -912,6 +923,8 @@ totem_embedded_set_local_cache (TotemEmbedded *emb,
 {
 	int fd;
 
+	g_message ("totem_embedded_set_local_cache: %s", path);
+
 	/* FIXME Should also handle playlists */
 	if (!emb->is_browser_stream)
 		return TRUE;
@@ -944,8 +957,8 @@ totem_embedded_set_playlist (TotemEmbedded *emb,
 	GFile *src, *dst;
 	int fd;
 
-	g_message ("Setting the current playlist to %s (base: %s)",
-		   path, base_uri);
+	g_message ("Setting the current playlist to %s (uri: %s base: %s)",
+		   path, uri, base_uri);
 
 	totem_embedded_clear_playlist (emb, NULL);
 
diff --git a/browser-plugin/totemPlugin.cpp b/browser-plugin/totemPlugin.cpp
index c3e3c94..bbc4393 100644
--- a/browser-plugin/totemPlugin.cpp
+++ b/browser-plugin/totemPlugin.cpp
@@ -828,6 +828,7 @@ totemPlugin::ViewerReady ()
 #ifdef TOTEM_NARROWSPACE_PLUGIN
 	/* Tell the viewer it has an href */
 	if (mHref) {
+		Dm("SetHref in ViewerReady");
 		dbus_g_proxy_call_no_reply (mViewerProxy,
 					    "SetHref",
 					    G_TYPE_STRING, mHref,
@@ -2585,6 +2586,7 @@ totemPlugin::StreamAsFile (NPStream *stream,
 	gboolean retval = TRUE;
 	GError *error = NULL;
 	if (mIsPlaylist) {
+		Dm("Calling SetPlaylist in StreamAsFile");
 		retval = dbus_g_proxy_call (mViewerProxy,
 					    "SetPlaylist",
 					    &error,
@@ -2599,6 +2601,7 @@ totemPlugin::StreamAsFile (NPStream *stream,
 	 * completely in the cache.)
 	 */
 	else if (mBytesStreamed == 0) {
+		Dm("Calling SetLocalFile from ViewerReady");
 		retval = dbus_g_proxy_call (mViewerProxy,
 					    "SetLocalFile",
 					    &error,
@@ -2647,7 +2650,13 @@ totemPlugin::URLNotify (const char *url,
 		        NPReason reason,
 		        void *notifyData)
 {
-	D ("URLNotify URL '%s' reason %d", url ? url : "", reason);
+	const char *reasons[] = {
+		"Base (undefined)",
+		"Done",
+		"Network error",
+		"User break"
+	};
+	D ("URLNotify URL '%s' reason %d (%s)", url ? url : "", reason, reasons[reason]);
 
 	/* If we get called when we expect a stream,
 	 * it means that the stream failed.



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