[Goodies-commits] r6143 - xfce4-xmms-plugin/trunk/panel-plugin
Kemal Eroglu
ilgar at xfce.org
Thu Nov 20 21:39:39 CET 2008
Author: ilgar
Date: 2008-11-20 20:39:39 +0000 (Thu, 20 Nov 2008)
New Revision: 6143
Modified:
xfce4-xmms-plugin/trunk/panel-plugin/xmms_plugin.c
Log:
Fix in xmms_plugin.c
Modified: xfce4-xmms-plugin/trunk/panel-plugin/xmms_plugin.c
===================================================================
--- xfce4-xmms-plugin/trunk/panel-plugin/xmms_plugin.c 2008-11-20 20:38:30 UTC (rev 6142)
+++ xfce4-xmms-plugin/trunk/panel-plugin/xmms_plugin.c 2008-11-20 20:39:39 UTC (rev 6143)
@@ -288,23 +288,12 @@
if (running) {
pos = pd->pctrl->player_get_playlist_pos(pd->xmms_session);
time = pd->pctrl->player_get_playlist_time(pd->xmms_session, pos) / 1000;
- title_orig = pd->pctrl->player_get_playlist_title(pd->xmms_session, pos);
-
- /* Fix for invalid UTF-8 strings crashing the plugin when using simple title format*/
- title = g_locale_to_utf8 (title_orig, -1, NULL, NULL, NULL);
-
- /*valid = g_utf8_validate (title_orig, -1, NULL);
-
- if (!valid) {
- title=" ";
- } else {
- title = title_orig;
- }*/
-
+ title = pd->pctrl->player_get_playlist_title(pd->xmms_session, pos);
+
if (pd->simple_title)
- tooltip = g_strdup_printf("%s", title);
+ tooltip = g_strdup_printf("%s", g_locale_to_utf8 (title, -1, NULL, NULL, NULL));
else
- tooltip = g_strdup_printf("%d: %s (%d:%02d)", pos+1, title, time/60, time%60);
+ tooltip = g_strdup_printf("%d: %s (%d:%02d)", pos+1, g_locale_to_utf8 (title, -1, NULL, NULL, NULL), time/60, time%60);
}
else
tooltip = g_strdup_printf(TITLE_STRING);
@@ -316,8 +305,7 @@
pd->labelattr->end_index = strlen(label);
gtk_label_set_attributes(GTK_LABEL(pd->label), pd->labelattrlist);
gtk_label_set_text(GTK_LABEL(pd->label), label);
- g_free(title_orig);
- g_free(title);
+ //g_free(title);
g_free(tooltip);
g_free(label);
}
More information about the Goodies-commits
mailing list