banshee r5062 - in trunk/banshee: . src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView src/Libraries/Hyena/Hyena.Data



Author: gburt
Date: Wed Feb 25 18:26:04 2009
New Revision: 5062
URL: http://svn.gnome.org/viewvc/banshee?rev=5062&view=rev

Log:
2009-02-25  Gabriel Burt  <gabriel burt gmail com>

	* src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs:
	* src/Libraries/Hyena/Hyena.Data/ColumnDescription.cs: Fix another freeze
	in the RecalculateColumnSize code due to some values getting set to NaN.

Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
   trunk/banshee/src/Libraries/Hyena/Hyena.Data/ColumnDescription.cs

Modified: trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena.Gui/Hyena.Data.Gui/ListView/ListView_Header.cs	Wed Feb 25 18:26:04 2009
@@ -230,10 +230,11 @@
                 column_cache[i].ElasticWidth += delta;
             }
             
-            if (Math.Abs (total_width - remaining_width) < 1.0) {
+            if (Math.Abs (total_width - remaining_width) < 1.0 || remaining_width == Double.NaN) {
                 Hyena.Log.Warning ("Forcefully breaking out of RCS loop b/c change in total_width less than 1.0");
                 return 0;
             }
+
             return Math.Round (remaining_width);
         }
         

Modified: trunk/banshee/src/Libraries/Hyena/Hyena.Data/ColumnDescription.cs
==============================================================================
--- trunk/banshee/src/Libraries/Hyena/Hyena.Data/ColumnDescription.cs	(original)
+++ trunk/banshee/src/Libraries/Hyena/Hyena.Data/ColumnDescription.cs	Wed Feb 25 18:26:04 2009
@@ -37,6 +37,8 @@
         private double width;
         private bool visible;
         private string property;
+
+        private bool initialized;
         
         public event EventHandler VisibilityChanged;
         public event EventHandler WidthChanged;
@@ -50,8 +52,9 @@
             this.property = property;
             this.title = title;
             this.long_title = title;
-            this.width = width;
-            this.visible = visible;
+            Width = width;
+            Visible = visible;
+            initialized = true;
         }
                 
         protected virtual void OnVisibilityChanged ()
@@ -83,11 +86,14 @@
         public double Width {
             get { return width; }
             set {
+                if (Double.IsNaN (value)) {
+                    return;
+                }
+
                 double old = width;
-                //Console.WriteLine ("Changing width of {0} from {1} to {2}", Title, Width, value);
                 width = value;
-                
-                if (value != old) {
+
+                if (initialized && value != old) {
                     OnWidthChanged ();
                 }
             }
@@ -104,7 +110,7 @@
                 bool old = Visible;
                 visible = value;
                 
-                if(value != old) {
+                if(initialized && value != old) {
                     OnVisibilityChanged ();
                 }
             }



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