[banshee/gtk3] ThickClient: simplify FilteredListSourceContents::Layout(bool)



commit 4c98653d7de421f2381e146653bad853d981e4c3
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Tue Mar 12 00:47:14 2013 +0000

    ThickClient: simplify FilteredListSourceContents::Layout(bool)
    
    Check the top parameter just once at the beginning of the method, no need
    to check three times.

 .../FilteredListSourceContents.cs                  |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs 
b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
index ffe9ef4..e827b38 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
@@ -228,6 +228,8 @@ namespace Banshee.Sources.Gui
             //Hyena.Log.Information ("ListBrowser LayoutLeft");
             Reset ();
 
+            SchemaEntry<int> current_entry = top ? pane_top_position : pane_left_position;
+
             container = GetPane (!top);
             Paned filter_box = GetPane (top);
             filter_box.PositionSet = true;
@@ -258,12 +260,12 @@ namespace Banshee.Sources.Gui
             container.Pack2 (main_scrolled_window, true, false);
             browser_container = filter_box;
 
-            if ((top && pane_top_position.Equals (SchemaEntry<int>.Zero)) || (!top && 
pane_left_position.Equals (SchemaEntry<int>.Zero))) {
+            if (current_entry.Equals (SchemaEntry<int>.Zero)) {
                 throw new InvalidOperationException (String.Format ("No SchemaEntry found for {0} position 
of {1}",
                                                                     top.ToString (), this.GetType 
().FullName));
             }
-            container.Position = top ? pane_top_position.DefaultValue : pane_left_position.DefaultValue;
-            PersistentPaneController.Control (container, top ? pane_top_position : pane_left_position);
+            container.Position = current_entry.DefaultValue;
+            PersistentPaneController.Control (container, current_entry);
             ShowPack ();
         }
 


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