[Goodies-commits] r6227 - in xfce4-radio-plugin/trunk: . panel-plugin

Stefan Ott cockroach at xfce.org
Sun Nov 30 04:37:04 CET 2008


Author: cockroach
Date: 2008-11-30 03:37:04 +0000 (Sun, 30 Nov 2008)
New Revision: 6227

Modified:
   xfce4-radio-plugin/trunk/NEWS
   xfce4-radio-plugin/trunk/panel-plugin/radio.c
Log:
Fixed #4397 (encoding)


Modified: xfce4-radio-plugin/trunk/NEWS
===================================================================
--- xfce4-radio-plugin/trunk/NEWS	2008-11-29 22:51:08 UTC (rev 6226)
+++ xfce4-radio-plugin/trunk/NEWS	2008-11-30 03:37:04 UTC (rev 6227)
@@ -1,10 +1,11 @@
 Get the latest version of this plugin at http://goodies.xfce.org/
 ===============================================================================
 
-v0.4.0 (xx xxx 2008):
+v0.4.0 (30 Nov 2008):
 =====================
  * The "thanks for all the patches"-release
  * We now use a clearly-defined name for the config file (xfce4/panel/radio.rc)
+ * Fixes for non-ASCII (eg. UTF8) station preset names
 
 v0.3.1 (18 Jun 2008):
 =====================

Modified: xfce4-radio-plugin/trunk/panel-plugin/radio.c
===================================================================
--- xfce4-radio-plugin/trunk/panel-plugin/radio.c	2008-11-29 22:51:08 UTC (rev 6226)
+++ xfce4-radio-plugin/trunk/panel-plugin/radio.c	2008-11-30 03:37:04 UTC (rev 6227)
@@ -95,36 +95,40 @@
 static void
 update_label (radio_gui* data)
 {
-	char *label = malloc (MAX_LABEL_LENGTH + 1);
+	gchar *label;
 
 	if (data->on) {
-		sprintf (label, "%5.1f", ((float) data->freq) / 100);
+		label = g_strdup_printf ("%5.1f", ((float) data->freq) / 100);
 		update_tooltip (data);
 	} else {
-		strcpy (label, _("- off -"));
+		label = g_strdup (_("- off -"));
 	}
+
 	gtk_label_set_label (GTK_LABEL (data->label), label);
 
-	free (label);
+	g_free (label);
 }
 
-static gboolean update_radio(radio_gui *data) {
+static gboolean
+update_radio (radio_gui *data)
+{
 	struct video_audio vid_aud;
 	long freq;
 
 	if (!data->on) {
-		data->fd = open(data->device, O_RDONLY);
+		data->fd = open (data->device, O_RDONLY);
 
 		// should I return FALSE here to stop timer?
 		if (data->fd == -1)
 			return TRUE;
 	}
 
-	if (ioctl(data->fd, VIDIOCGAUDIO, &vid_aud))
-		perror("VIDIOCGAUDIO");
+	if (ioctl (data->fd, VIDIOCGAUDIO, &vid_aud))
+		perror ("VIDIOCGAUDIO");
 
 	if (vid_aud.flags & VIDEO_AUDIO_MUTE) {
-		close(data->fd);
+		close (data->fd);
+		printf ("It just happened\n");
 
 		// Radio is off.  Did I think it was on?
 		if (data->on) {
@@ -141,8 +145,8 @@
 			data->on = TRUE;
 		}
 
-		if (ioctl(data->fd, VIDIOCGFREQ, &freq)) {
-			perror("VIDIOCGFREQ");
+		if (ioctl (data->fd, VIDIOCGFREQ, &freq)) {
+			perror ("VIDIOCGFREQ");
 			return TRUE; // should maybe be FALSE?
 		}
 
@@ -153,8 +157,8 @@
 		data->freq = freq;
 	}
 
-	update_label(data);
-	update_signal_bar(data);
+	update_label (data);
+	update_signal_bar (data);
 
 	return TRUE;
 }




More information about the Goodies-commits mailing list