Re: [Nautilus-list] [PATCH] make the music-view show song info as it should



On dom, 2002-03-10 at 16:57, Christian Rose wrote:
> sön 2002-03-10 klockan 16.49 skrev Diego González:
> > 	This little patch to the music view make it show song info with
> > "special" characters.
> [...]
> > +	if (tag.title != NULL)
> > +		song_info->title = g_locale_to_utf8 (tag.title, -1, NULL, NULL, NULL);
> > +	if (tag.artist != NULL)
> > +		song_info->artist = g_locale_to_utf8 (tag.artist, -1, NULL, NULL, NULL);
> > +	if (tag.album)
> > +		song_info->album = g_locale_to_utf8 (tag.album, -1, NULL, NULL, NULL); 
> > +	song_info->year = filter_out_unset_year (tag.year);
> > +	if (tag.comment != NULL)
> > +		song_info->comment = g_locale_to_utf8 (tag.comment, -1, NULL, NULL, NULL);
> 
> Hmm, I think Nautilus coding style requires you to use {} also around
> one-line if statements.
> At least I think I've heard that on this list on a few occasions before.
> ;-)

Certainly, thanks a lot :-)

New patch, with the braces corrected.
> 
> 
> Christian
> 
> 
> 
> _______________________________________________
> nautilus-list mailing list
> nautilus-list lists eazel com
> http://lists.eazel.com/mailman/listinfo/nautilus-list

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.5121
diff -u -r1.5121 ChangeLog
--- ChangeLog	10 Mar 2002 05:23:57 -0000	1.5121
+++ ChangeLog	10 Mar 2002 16:48:47 -0000
@@ -1,3 +1,8 @@
+2002-03-10  Diego González  <dggonz yahoo com>
+
+	* components/music/nautilus-music-vew.c (read_id_tag): convert
+	title, comments, artist and album to UTF-8
+
 2002-03-10  Alexander Larsson  <alla lysator liu se>
 
 	* src/nautilus-property-browser.c (element_clicked_callback):
Index: components/music/nautilus-music-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/components/music/nautilus-music-view.c,v
retrieving revision 1.166
diff -u -r1.166 nautilus-music-view.c
--- components/music/nautilus-music-view.c	7 Mar 2002 19:35:45 -0000	1.166
+++ components/music/nautilus-music-view.c	10 Mar 2002 16:48:48 -0000
@@ -886,11 +886,19 @@
 	}
 	
 	/* Copy data from tag into our info struct */
-	song_info->title = g_strdup (tag.title);
-	song_info->artist = g_strdup (tag.artist);
-	song_info->album = g_strdup (tag.album); 
-        song_info->year = filter_out_unset_year (tag.year);
-	song_info->comment = g_strdup (tag.comment);
+	if (song_info->title != NULL) {
+		song_info->title = g_locale_to_utf8 (tag.title, -1, NULL, NULL, NULL);
+	}
+	if (song_info->artist != NULL) {
+		song_info->artist = g_locale_to_utf8 (tag.artist, -1, NULL, NULL, NULL);
+	}
+	if (song_info->album != NULL) {
+		song_info->album = g_locale_to_utf8 (tag.album, -1, NULL, NULL, NULL); 
+	}
+	if (song_info->comment != NULL) {
+		song_info->comment = g_locale_to_utf8 (tag.comment, -1, NULL, NULL, NULL);
+	}
+	song_info->year = filter_out_unset_year (tag.year);
 	song_info->track_number = atoi (tag.track);
 
 	/* Clean up */


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