banshee r2979 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.ThickClient/Banshee.Sources.Gui



Author: scottp
Date: Thu Jan 17 06:36:52 2008
New Revision: 2979
URL: http://svn.gnome.org/viewvc/banshee?rev=2979&view=rev

Log:
* src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs:
  Eliminated an unnecessary comparison.
* src/Core/Banshee.Services/Banshee.Collection.Database/LibraryTrackInfo.cs:
  Fixed whitespace.

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryTrackInfo.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryTrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/LibraryTrackInfo.cs	Thu Jan 17 06:36:52 2008
@@ -133,7 +133,7 @@
             set {
                 uri_field = value;
                 if (uri_type_field.HasValue) {
-                    SetUpUri();
+                    SetUpUri ();
                 }
             }
         }
@@ -153,17 +153,23 @@
             set {
                 uri_type_field = value;
                 if (uri_field != null) {
-                    SetUpUri();
+                    SetUpUri ();
                 }
             }
         }
         
-        private void SetUpUri()
+        bool set_up;
+        private void SetUpUri ()
         {
+            if (set_up) {
+                return;
+            }
+            set_up = true;
+            
             if (uri_type_field.Value == (int)UriType.RelativePath) {
-                uri_field = System.IO.Path.Combine(Paths.LibraryLocation, uri_field);
+                uri_field = System.IO.Path.Combine (Paths.LibraryLocation, uri_field);
             }
-            Uri = new SafeUri(uri_field);
+            Uri = new SafeUri (uri_field);
         }
         
         [DatabaseColumn]

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceView.cs	Thu Jan 17 06:36:52 2008
@@ -760,7 +760,7 @@
             if(titleLayoutWidth > maxTitleLayoutWidth) {
                 float ratio = (float)(maxTitleLayoutWidth - ellipsisSize) / (float)titleLayoutWidth;
                 int characters = (int)(ratio * (float)titleText.Length);
-                while(titleLayoutWidth > maxTitleLayoutWidth) {
+                do {
                     if(characters > 0) {
                         titleLayout.SetMarkup(GLib.Markup.EscapeText(
                             titleText.Substring(0, characters--)).Trim() + "...");
@@ -770,7 +770,7 @@
                         titleLayout.SetMarkup(GLib.Markup.EscapeText(titleText.Trim()));
                         break;
                     }
-                }
+                } while (titleLayoutWidth > maxTitleLayoutWidth);
             }
             
             Gdk.GC mainGC = widget.Style.TextGC(state);



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