[banshee] Banshee.Collection: refactoring around Unknown constant variables



commit ce18689aa7919d888ebe1fd586d8c2adcf4395e0
Author: Andrés G. Aragoneses <knocte gmail com>
Date:   Thu Sep 5 12:31:36 2013 +0200

    Banshee.Collection: refactoring around Unknown constant variables
    
    The read-only variables that don't call Catalog.GetString() can be marked
    as a constant instead of static readonly. This may be a micro-optimization
    but it lets us make the static readonly ones reference the constants so
    there is less duplication.

 .../Banshee.Core/Banshee.Collection/AlbumInfo.cs   |    4 ++--
 .../Banshee.Core/Banshee.Collection/ArtistInfo.cs  |    4 ++--
 .../Banshee.Core/Banshee.Collection/TrackInfo.cs   |    4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs 
b/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
index 44124aa..f96000a 100644
--- a/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
+++ b/src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
@@ -37,8 +37,8 @@ namespace Banshee.Collection
 {
     public class AlbumInfo : CacheableItem
     {
-        public static readonly string UnknownAlbumTitle = Catalog.GetString ("Unknown Album");
-        public static readonly string UnknownAlbumTitleUntranslated = "Unknown Album";
+        public const string UnknownAlbumTitleUntranslated = "Unknown Album";
+        public static readonly string UnknownAlbumTitle = Catalog.GetString (UnknownAlbumTitleUntranslated);
 
         private string title;
         private string title_sort;
diff --git a/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs 
b/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
index 50025b7..7f236b1 100644
--- a/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
+++ b/src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
@@ -34,8 +34,8 @@ namespace Banshee.Collection
 {
     public class ArtistInfo : CacheableItem
     {
-        public static readonly string UnknownArtistName = Catalog.GetString ("Unknown Artist");
-        public static readonly string UnknownArtistNameUntranslated = "Unknown Artist";
+        public const string UnknownArtistNameUntranslated = "Unknown Artist";
+        public static readonly string UnknownArtistName = Catalog.GetString (UnknownArtistNameUntranslated);
 
         private string name;
         private string name_sort;
diff --git a/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs 
b/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
index 2014e72..2e85dd4 100644
--- a/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
+++ b/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
@@ -46,8 +46,8 @@ namespace Banshee.Collection
         public const string ExportVersion = "1.0";
         public static readonly double PlaybackSkippedThreshold = 0.5;
 
-        public static readonly string UnknownTitle = Catalog.GetString ("Unknown Title");
-        public static readonly string UnknownTitleUntranslated = "Unknown Title";
+        public const string UnknownTitleUntranslated = "Unknown Title";
+        public static readonly string UnknownTitle = Catalog.GetString (UnknownTitleUntranslated);
 
         public class ExportableAttribute : Attribute
         {


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