banshee r4383 - in trunk/banshee: . src/Dap/Banshee.Dap/Banshee.Dap.Gui



Author: gburt
Date: Fri Aug 15 21:36:48 2008
New Revision: 4383
URL: http://svn.gnome.org/viewvc/banshee?rev=4383&view=rev

Log:
2008-08-15  Gabriel Burt  <gabriel burt gmail com>

	* src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapInfoBar.cs: Avoid NRE, and move a
	delegate to a method.

	* configure.ac: turn DEVEL_BUILD back on


Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/configure.ac
   trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapInfoBar.cs

Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac	(original)
+++ trunk/banshee/configure.ac	Fri Aug 15 21:36:48 2008
@@ -2,7 +2,7 @@
 
 AC_INIT([banshee-1], [1.2.1]) 
 ASM_DISPLAY_VERSION="1.2.1"
-DEVEL_BUILD=no
+DEVEL_BUILD=yes
 
 AC_CANONICAL_SYSTEM
 AC_PREREQ(2.13)

Modified: trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapInfoBar.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapInfoBar.cs	(original)
+++ trunk/banshee/src/Dap/Banshee.Dap/Banshee.Dap.Gui/DapInfoBar.cs	Fri Aug 15 21:36:48 2008
@@ -62,12 +62,7 @@
             
             disk_bar_align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
             disk_bar = new SegmentedBar ();
-            disk_bar.ValueFormatter = delegate (SegmentedBar.Segment segment) {
-                long size = (long)(source.BytesCapacity * segment.Percent);
-                return size <= 0 
-                    ? Catalog.GetString ("None")
-                    : new Hyena.Query.FileSizeQueryValue (size).ToUserQuery ();
-            };
+            disk_bar.ValueFormatter = DapValueFormatter;
             
             disk_bar.AddSegmentRgb (Catalog.GetString ("Audio"), 0, 0x3465a4);
             disk_bar.AddSegmentRgb (Catalog.GetString ("Video"), 0, 0x73d216);
@@ -89,6 +84,18 @@
                 disk_bar.HorizontalPadding = (int)(args.Allocation.Width * 0.25);
             };
         }
+
+        private string DapValueFormatter (SegmentedBar.Segment segment)
+        {
+            if (source == null) {
+                return null;
+            }
+
+            long size = (long)(source.BytesCapacity * segment.Percent);
+            return size <= 0 
+                ? Catalog.GetString ("None")
+                : new Hyena.Query.FileSizeQueryValue (size).ToUserQuery ();
+        }
         
         private void OnSourceUpdated (object o, EventArgs args)
         {



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