Index: banshee/ChangeLog
===================================================================
--- banshee/ChangeLog	(revision 4038)
+++ banshee/ChangeLog	(working copy)
@@ -1,3 +1,25 @@
+2008-05-30  Andres G. Aragoneses <aaragoneses@novell.com>
+
+	Patch for BGO #528493
+
+	* src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs:
+	rather bind to the Display* properties in order to get the meta information.
+
+	* src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs,
+	src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs,
+	src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs:
+	We now don't fake the real names/titles with 'Unknown' meta-information if they
+	are empty (but we keep this content searchable).
+
+	* src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs: Use NameConversionHelper
+	in order to reuse this behaviour across all the codebase instead of hardcoding strings.
+
+	* src/Core/Banshee.Core/Banshee.Collection/NameConversionHelper.cs: New file that
+	has the constant string for null values.
+
+	* src/Core/Banshee.Core/Makefile.am,
+	src/Core/Banshee.Core/Banshee.Core.mdp: Added new file NameConversionHelper.cs.
+
 2008-05-30  Gabriel Burt  <gabriel.burt@gmail.com>
 
 	* src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs: Add property
Index: banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs
===================================================================
--- banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	(revision 4038)
+++ banshee/src/Core/Banshee.ThickClient/Banshee.Collection.Gui/DefaultColumnController.cs	(working copy)
@@ -95,19 +95,19 @@
         }
         
         private SortableColumn title_column = new SortableColumn (Catalog.GetString ("Title"), 
-            new ColumnCellText ("TrackTitle", true), 0.25, "Title", true);
+            new ColumnCellText ("DisplayTrackTitle", true), 0.25, "Title", true);
         public SortableColumn TitleColumn {
             get { return title_column; }
         }
         
         private SortableColumn artist_column = new SortableColumn (Catalog.GetString ("Artist"), 
-            new ColumnCellText ("ArtistName", true), 0.225, "Artist", true);
+            new ColumnCellText ("DisplayArtistName", true), 0.225, "Artist", true);
         public SortableColumn ArtistColumn {
             get { return artist_column; }
         }
         
         private SortableColumn album_column = new SortableColumn (Catalog.GetString ("Album"), 
-            new ColumnCellText ("AlbumTitle", true), 0.225, "Album", true);
+            new ColumnCellText ("DisplayAlbumTitle", true), 0.225, "Album", true);
         public SortableColumn AlbumColumn {
             get { return album_column; }
         }
Index: banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
===================================================================
--- banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs	(revision 4038)
+++ banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs	(working copy)
@@ -36,6 +36,7 @@
 
 using Banshee.Database;
 using Banshee.ServiceStack;
+using Banshee.Collection;
 
 namespace Banshee.Collection.Database
 {
@@ -79,7 +80,7 @@
             }
 
             if (String.IsNullOrEmpty (album.Title) || album.Title.Trim () == String.Empty) {
-                album.Title = Catalog.GetString ("Unknown Album");
+                album.Title = String.Empty;
             }
 
             using (IDataReader reader = ServiceManager.DbConnection.Query (select_command, artist.DbId, album.Title)) {
@@ -155,7 +156,7 @@
         
         [DatabaseColumn(Select = false)]
         protected string TitleLowered {
-            get { return Title == null ? null : Title.ToLower (); }
+            get { return NameConversionHelper.LoweredAlbum (Title); }
         }
 
         [VirtualDatabaseColumn("Name", "CoreArtists", "ArtistID", "ArtistID")]
Index: banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
===================================================================
--- banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	(revision 4038)
+++ banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	(working copy)
@@ -140,6 +140,10 @@
                 // TODO get rid of unused artists/albums
             }
             
+            if (String.IsNullOrEmpty (TrackTitle) || TrackTitle.Trim () == String.Empty) {
+                TrackTitle = String.Empty;
+            }
+            
             DateUpdated = DateTime.Now;
 
             bool is_new = (TrackId == 0);
@@ -331,7 +335,7 @@
         
         [DatabaseColumn(Select = false)]
         protected string TitleLowered {
-            get { return TrackTitle == null ? null : TrackTitle.ToLower (); }
+            get { return NameConversionHelper.LoweredTitle (TrackTitle); }
         }
         
         [DatabaseColumn]
Index: banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
===================================================================
--- banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs	(revision 4038)
+++ banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs	(working copy)
@@ -77,7 +77,7 @@
             }
 
             if (String.IsNullOrEmpty (artist.Name) || artist.Name.Trim () == String.Empty) {
-                artist.Name = Catalog.GetString ("Unknown Artist");
+                artist.Name = String.Empty;
             }
 
             using (IDataReader reader = ServiceManager.DbConnection.Query (select_command, artist.Name)) {
@@ -134,7 +134,7 @@
         
         [DatabaseColumn(Select = false)]
         protected string NameLowered {
-            get { return Name == null ? null : Name.ToLower (); }
+            get { return NameConversionHelper.LoweredArtist (Name); }
         }
 
         public override string ToString ()
Index: banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
===================================================================
--- banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(revision 4038)
+++ banshee/src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs	(working copy)
@@ -171,28 +171,19 @@
         
         public string DisplayArtistName { 
             get {
-                string name = ArtistName == null ? null : ArtistName.Trim ();
-                return String.IsNullOrEmpty (name)
-                    ? Catalog.GetString ("Unknown Artist") 
-                    : name; 
+                return NameConversionHelper.DisplayArtist (ArtistName);
             } 
         }
 
         public string DisplayAlbumTitle { 
             get { 
-                string title = AlbumTitle == null ? null : AlbumTitle.Trim ();
-                return String.IsNullOrEmpty (title) 
-                    ? Catalog.GetString ("Unknown Album") 
-                    : title; 
+                return NameConversionHelper.DisplayAlbum (AlbumTitle);
             } 
         }
 
         public string DisplayTrackTitle { 
             get { 
-                string title = TrackTitle == null ? null : TrackTitle.Trim ();
-                return String.IsNullOrEmpty (title) 
-                    ? Catalog.GetString ("Unknown Title") 
-                    : title; 
+                return NameConversionHelper.DisplayTitle (TrackTitle);
             } 
         }     
         
Index: banshee/src/Core/Banshee.Core/Banshee.Collection/NameConversionHelper.cs
===================================================================
--- banshee/src/Core/Banshee.Core/Banshee.Collection/NameConversionHelper.cs	(revision 0)
+++ banshee/src/Core/Banshee.Core/Banshee.Collection/NameConversionHelper.cs	(revision 0)
@@ -0,0 +1,98 @@
+//
+// NameConversionHelper.cs
+//
+// Author:
+//   Andres G. Aragoneses <aaragoneses@novell.com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections.Generic;
+
+using Mono.Unix;
+
+namespace Banshee.Collection
+{
+    public static class NameConversionHelper
+    {   
+        public static string DisplayArtist (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Artist);
+        }
+        
+        public static string DisplayAlbum (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Album);
+        }
+        
+        public static string DisplayTitle (string orig_name)
+        {
+            return Name (orig_name, DisplayType.Title);
+        }
+
+        public static string LoweredArtist (string orig_name)
+        {
+            return DisplayArtist (orig_name).ToLower ();
+        }
+        
+        public static string LoweredAlbum (string orig_name)
+        {
+            return DisplayAlbum (orig_name).ToLower ();
+        }
+
+        public static string LoweredTitle (string orig_name)
+        {
+            return DisplayTitle (orig_name).ToLower ();
+        }
+
+        private enum DisplayType {
+            Artist, 
+            Album,
+            Title
+        }
+        
+        private static string Name (string orig_name, DisplayType type)
+        {
+            string name = orig_name == null ? null : orig_name.Trim ();
+            return String.IsNullOrEmpty (name)
+                ? MetaString (name, type) 
+                : name; 
+        }
+        
+        private static string MetaString (string str, DisplayType type)
+        {
+            switch(type) {
+            case DisplayType.Album:
+                str = Catalog.GetString ("Unknown Album");
+                break;
+            case DisplayType.Artist:
+                str = Catalog.GetString ("Unknown Artist");
+                break;
+            case DisplayType.Title:
+                str = Catalog.GetString ("Unknown Title");
+                break;
+            }
+            return str;
+        }
+    }
+}
Index: banshee/src/Core/Banshee.Core/Makefile.am
===================================================================
--- banshee/src/Core/Banshee.Core/Makefile.am	(revision 4038)
+++ banshee/src/Core/Banshee.Core/Makefile.am	(working copy)
@@ -22,6 +22,7 @@
 	Banshee.Collection/FileTrackInfo.cs \
 	Banshee.Collection/IBasicTrackInfo.cs \
 	Banshee.Collection/ITrackInfo.cs \
+	Banshee.Collection/NameConversionHelper.cs \
 	Banshee.Collection/SampleTrackInfo.cs \
 	Banshee.Collection/TrackAttributes.cs \
 	Banshee.Collection/TrackFilterType.cs \
