GNOME Bugzilla – Bug 573093
don't display "0 of 0" and "xx of 0" in discnumber
Last modified: 2009-08-05 14:56:55 UTC
Attached patch prettifies display of Disc Count column in GUI. When tracknumber is zero, it shows "0 of 0". Also, when discnumber is not specified but track is, display shows "2 of 0" or similar. Solution: omit "of 0" if there is no disc number specified. Also don't display anything if tracknumber is zero.
Created attachment 129477 [details] [review] patch for omiting "of 0" and "0 of 0" display in discnumber column
Comment on attachment 129477 [details] [review] patch for omiting "of 0" and "0 of 0" display in discnumber column >+ if (track.DiscCount == 0) { >+ format = "{0}"; >+ } This is a poor idea; it will modify the global format for all disc counts. Perhaps instead, you could write something like: private static readonly string multi_format = Catalog.GetString ("{0} of {1}"); -------- ------ ... (in GetText) string format = (track.DiscCount == 0 ? "{0}" : multi_format);
Forgot to mention: similar changes ought to be made to ColumnCellTrackAndCount.GeText().
Created attachment 129622 [details] [review] Ignore values of 0 in disc and track counts
*** Bug 575683 has been marked as a duplicate of this bug. ***
John, can you change + return String.Format (track.TrackCount == 0? "{0}" : format, + track.TrackNumber, track.TrackCount); to + return track.TrackCount != 0 ? String.Format (format, track.TrackNumber, track.TrackCount) : track.TrackNumber.ToString () and the same for the other class. Given that, commit away.