[Goodies-commits] r6845 - in xfmpc/trunk: . src
Mike Massonnet
mmassonnet at xfce.org
Wed Mar 4 17:15:21 CET 2009
Author: mmassonnet
Date: 2009-03-04 16:15:21 +0000 (Wed, 04 Mar 2009)
New Revision: 6845
Modified:
xfmpc/trunk/ChangeLog
xfmpc/trunk/src/mpdclient.c
xfmpc/trunk/src/preferences.c
xfmpc/trunk/src/preferences.h
Log:
Fix in custom format
Modified: xfmpc/trunk/ChangeLog
===================================================================
--- xfmpc/trunk/ChangeLog 2009-03-04 13:42:20 UTC (rev 6844)
+++ xfmpc/trunk/ChangeLog 2009-03-04 16:15:21 UTC (rev 6845)
@@ -1,3 +1,14 @@
+2009-03-04 Mike Massonnet <mmassonnet at xfce.org>
+
+Fix in custom format
+ * src/preferences.[ch]:
+ - Put "Album - Title" at the second line
+ * src/mpdclient.c(_get_formatted_name_custom):
+ - Fix a crash when a tag didn't exist -- tmp was not set and it
+ broke when it came to free() and reset formatted_name and in fact an
+ unexistent tag is nil hence it is useless to check if it exists and
+ pass it as is in g_strconcat
+
2009-03-03 Vincent Legout <vincent at legout.info>
New menu item Browse in the playlist
Modified: xfmpc/trunk/src/mpdclient.c
===================================================================
--- xfmpc/trunk/src/mpdclient.c 2009-03-04 13:42:20 UTC (rev 6844)
+++ xfmpc/trunk/src/mpdclient.c 2009-03-04 16:15:21 UTC (rev 6845)
@@ -1075,43 +1075,35 @@
switch (*(format))
{
case 'a':
- if (song->artist)
- tmp = g_strconcat (formatted_name, song->artist, NULL);
+ tmp = g_strconcat (formatted_name, song->artist, NULL);
break;
case 'A':
- if (song->album)
- tmp = g_strconcat (formatted_name, song->album, NULL);
+ tmp = g_strconcat (formatted_name, song->album, NULL);
break;
case 'd':
- if (song->date)
- tmp = g_strconcat (formatted_name, song->date, NULL);
+ tmp = g_strconcat (formatted_name, song->date, NULL);
break;
case 'D':
- if (song->disc)
- tmp = g_strconcat (formatted_name, song->disc, NULL);
+ tmp = g_strconcat (formatted_name, song->disc, NULL);
break;
case 'f':
- if (song->file)
- tmp = g_strconcat (formatted_name, song->file, NULL);
+ tmp = g_strconcat (formatted_name, song->file, NULL);
break;
case 'g':
- if (song->genre)
- tmp = g_strconcat (formatted_name, song->genre, NULL);
+ tmp = g_strconcat (formatted_name, song->genre, NULL);
break;
case 't':
- if (song->title)
- tmp = g_strconcat (formatted_name, song->title, NULL);
+ tmp = g_strconcat (formatted_name, song->title, NULL);
break;
case 'T':
- if (song->track)
- tmp = g_strconcat (formatted_name, song->track, NULL);
+ tmp = g_strconcat (formatted_name, song->track, NULL);
break;
default:
Modified: xfmpc/trunk/src/preferences.c
===================================================================
--- xfmpc/trunk/src/preferences.c 2009-03-04 13:42:20 UTC (rev 6844)
+++ xfmpc/trunk/src/preferences.c 2009-03-04 16:15:21 UTC (rev 6845)
@@ -39,12 +39,12 @@
static const GEnumValue values[] = {
{ XFMPC_SONG_FORMAT_TITLE, "XFMPC_SONG_FORMAT_TITLE", N_("Title"), },
+ { XFMPC_SONG_FORMAT_ALBUM_TITLE, "XFMPC_SONG_FORMAT_ALBUM_TITLE", N_("Album - Title"), },
{ XFMPC_SONG_FORMAT_ARTIST_TITLE, "XFMPC_SONG_FORMAT_ARTIST_TITLE", N_("Artist - Title"), },
- { XFMPC_SONG_FORMAT_ALBUM_TITLE, "XFMPC_SONG_FORMAT_ALBUM_TITLE", N_("Album - Title"), },
{ XFMPC_SONG_FORMAT_ARTIST_TITLE_DATE, "XFMPC_SONG_FORMAT_ARTIST_TITLE_DATE", N_("Artist - Title (Date)"), },
{ XFMPC_SONG_FORMAT_ARTIST_ALBUM_TITLE, "XFMPC_SONG_FORMAT_ARTIST_ALBUM_TITLE", N_("Artist - Album - Title"), },
{ XFMPC_SONG_FORMAT_ARTIST_ALBUM_TRACK_TITLE, "XFMPC_SONG_FORMAT_ARTIST_ALBUM_TRACK_TITLE", N_("Artist - Album - Track. Title"), },
- { XFMPC_SONG_FORMAT_CUSTOM, "XFMPC_SONG_FORMAT_CUSTOM", N_("Custom"), },
+ { XFMPC_SONG_FORMAT_CUSTOM, "XFMPC_SONG_FORMAT_CUSTOM", N_("Custom..."), },
{ 0, NULL, NULL },
};
Modified: xfmpc/trunk/src/preferences.h
===================================================================
--- xfmpc/trunk/src/preferences.h 2009-03-04 13:42:20 UTC (rev 6844)
+++ xfmpc/trunk/src/preferences.h 2009-03-04 16:15:21 UTC (rev 6845)
@@ -24,8 +24,8 @@
typedef enum
{
XFMPC_SONG_FORMAT_TITLE,
+ XFMPC_SONG_FORMAT_ALBUM_TITLE,
XFMPC_SONG_FORMAT_ARTIST_TITLE,
- XFMPC_SONG_FORMAT_ALBUM_TITLE,
XFMPC_SONG_FORMAT_ARTIST_TITLE_DATE,
XFMPC_SONG_FORMAT_ARTIST_ALBUM_TITLE,
XFMPC_SONG_FORMAT_ARTIST_ALBUM_TRACK_TITLE,
More information about the Goodies-commits
mailing list