changeset 3902:1792ab581321

fix improper rendering of data
author William Pitcock <nenolod@atheme.org>
date Tue, 06 Nov 2007 12:35:26 -0600
parents 2bb32f15569e
children 134cc28dc468
files src/audtool/audtool_handlers_playlist.c src/audtool/audtool_handlers_vitals.c
diffstat 2 files changed, 7 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/audtool/audtool_handlers_playlist.c	Tue Nov 06 12:33:03 2007 -0600
+++ b/src/audtool/audtool_handlers_playlist.c	Tue Nov 06 12:35:26 2007 -0600
@@ -339,7 +339,7 @@
 void playlist_tuple_field_data(gint argc, gchar **argv)
 {
 	gint i;
-	gpointer data;
+	gchar *data;
 
 	if (argc < 3)
 	{
@@ -362,17 +362,10 @@
 
 	if (!(data = audacious_get_tuple_field_data(dbus_proxy, argv[1], i - 1)))
 	{
-		return; //XXX ??? --yaz
+		return;
 	}
 	
-	if (!g_ascii_strcasecmp(argv[1], "track_number") || !g_ascii_strcasecmp(argv[1], "year") || !g_ascii_strcasecmp(argv[1], "length") || !g_ascii_strcasecmp(argv[1], "mtime"))
-	{
-		if (*(gint *)data > 0)
-		{
-			audtool_report("%d", *(gint *)data);
-		}
-		return;
-	}
+	audtool_report("%s", data);
 
-	audtool_report("%s", (gchar *)data);
+	g_free(data);
 }
--- a/src/audtool/audtool_handlers_vitals.c	Tue Nov 06 12:33:03 2007 -0600
+++ b/src/audtool/audtool_handlers_vitals.c	Tue Nov 06 12:35:26 2007 -0600
@@ -161,7 +161,7 @@
 
 void get_current_song_tuple_field_data(gint argc, gchar **argv)
 {
-	gpointer data;
+	gchar *data;
 
 	if (argc < 2)
 	{
@@ -179,14 +179,7 @@
 		return;
 	}
 	
-	if (!g_ascii_strcasecmp(argv[1], "track_number") || !g_ascii_strcasecmp(argv[1], "year") || !g_ascii_strcasecmp(argv[1], "length") || !g_ascii_strcasecmp(argv[1], "mtime"))
-	{
-		if (*(gint *)data > 0)
-		{
-			audtool_report("%d", *(gint *)data);
-		}
-		return;
-	}
+	audtool_report("%s", data);
 
-	audtool_report("%s", (gchar *)data);
+	g_free(data);
 }