banshee r5151 - in trunk/banshee: . src/Core/Banshee.ThickClient/Banshee.Collection.Gui



Author: jmillikin
Date: Sat Mar 21 00:49:05 2009
New Revision: 5151
URL: http://svn.gnome.org/viewvc/banshee?rev=5151&view=rev

Log:
2009-03-20  John Millikin  <jmillikin gmail com>

	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrackAndCount.cs:
	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDiscAndCount.cs:
	If the total disc or track count is 0, display only the disc/track
	number. If neither count is >0, display nothing. (BGO #573093)



Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDiscAndCount.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrackAndCount.cs

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDiscAndCount.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDiscAndCount.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellDiscAndCount.cs	Sat Mar 21 00:49:05 2009
@@ -37,7 +37,7 @@
     public class ColumnCellDiscAndCount : ColumnCellText
     {
         // Translators: this is {disc number} of {disc count}
-        private static string format = Catalog.GetString ("{0} of {1}");
+        private static readonly string format = Catalog.GetString ("{0} of {1}");
 
         public ColumnCellDiscAndCount (string property, bool expand) : base (property, expand)
         {
@@ -49,11 +49,12 @@
         protected override string GetText (object obj)
         {
             Banshee.Collection.TrackInfo track = BoundObjectParent as Banshee.Collection.TrackInfo;
-            if (track == null) {
+            if (track == null || track.DiscNumber == 0) {
                 return String.Empty;
             }
-
-            return String.Format (format, track.DiscNumber, track.DiscCount);
+            return track.DiscCount != 0
+                ? String.Format (format, track.DiscNumber, track.DiscCount)
+                : track.DiscNumber.ToString ();
         }
     }
-}
\ No newline at end of file
+}

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrackAndCount.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrackAndCount.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/ColumnCellTrackAndCount.cs	Sat Mar 21 00:49:05 2009
@@ -37,7 +37,7 @@
     public class ColumnCellTrackAndCount : ColumnCellText
     {
         // Translators: this is {track number} of {track count}
-        private static string format = Catalog.GetString ("{0} of {1}");
+        private static readonly string format = Catalog.GetString ("{0} of {1}");
 
         public ColumnCellTrackAndCount (string property, bool expand) : base (property, expand)
         {
@@ -49,11 +49,12 @@
         protected override string GetText (object obj)
         {
             Banshee.Collection.TrackInfo track = BoundObjectParent as Banshee.Collection.TrackInfo;
-            if (track == null) {
+            if (track == null || track.TrackNumber == 0) {
                 return String.Empty;
             }
-
-            return String.Format (format, track.TrackNumber, track.TrackCount);
+            return track.TrackCount != 0
+                ? String.Format (format, track.TrackNumber, track.TrackCount)
+                : track.TrackNumber.ToString ();
         }
     }
-}
\ No newline at end of file
+}



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