[banshee/gtk3] GSettings: improve previous commit, removing unneeded SchemaEntry instances



commit 40ab30081a9cdc5a0ebdda461debbf2e730281f8
Author: Andres G. Aragoneses <knocte gmail com>
Date:   Thu Mar 7 23:24:34 2013 +0000

    GSettings: improve previous commit, removing unneeded SchemaEntry instances
    
    The two classes InternetRadioSourceContents and PodcastSourceContents,
    which derive from FilteredListSourceContents, have a ForcePosition value
    of "left", which means that there is no need for having SchemaEntry
    static fields that map to the top position, so they are removed from this
    commit to avoid noise in the configuration schemas.

 .../FilteredListSourceContents.cs                  |    4 ++++
 .../InternetRadioSourceContents.cs                 |   14 +++-----------
 .../PodcastSourceContents.cs                       |   15 +++------------
 3 files changed, 10 insertions(+), 23 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs 
b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
index 81f8a6f..ffe9ef4 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/FilteredListSourceContents.cs
@@ -258,6 +258,10 @@ 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))) {
+                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);
             ShowPack ();
diff --git a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs 
b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs
index c590ed4..547e73e 100644
--- a/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs
+++ b/src/Extensions/Banshee.InternetRadio/Banshee.InternetRadio/InternetRadioSourceContents.cs
@@ -55,23 +55,15 @@ namespace Banshee.InternetRadio
 
         private static readonly string name = "iradio";
 
-        public static readonly SchemaEntry<int> PaneTopPosition = new SchemaEntry<int> (
-            String.Format ("{0}.{1}.browser.top", PersistentPaneController.NamespacePrefix, name),
-            "position",
-            DEFAULT_PANE_TOP_POSITION,
-            "Internet Radio Browser Pane Container Top Position",
-            "The position of the internet radio browser pane container, when placed at the top"
-        );
-
         public static readonly SchemaEntry<int> PaneLeftPosition = new SchemaEntry<int> (
             String.Format ("{0}.{1}.browser.left", PersistentPaneController.NamespacePrefix, name),
             "position",
             DEFAULT_PANE_LEFT_POSITION,
-            "Internet Radio Browser Pane Container Left Position",
-            "The position of the internet radio browser pane container, when placed on the left"
+            "Internet Radio Browser Pane Container Position",
+            "The position of the internet radio browser pane container"
         );
 
-        public InternetRadioSourceContents () : base (name, PaneTopPosition, PaneLeftPosition)
+        public InternetRadioSourceContents () : base (name, SchemaEntry<int>.Zero, PaneLeftPosition)
         {
         }
 
diff --git a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs 
b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
index 27e7d39..253be53 100644
--- a/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
+++ b/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Gui/PodcastSourceContents.cs
@@ -59,24 +59,15 @@ namespace Banshee.Podcasting.Gui
         private PodcastUnheardFilterView unheard_view;
         private static readonly string name = "podcast";
 
-        public static readonly SchemaEntry<int> PaneTopPosition = new SchemaEntry<int> (
-            String.Format ("{0}.{1}.browser.top", PersistentPaneController.NamespacePrefix, name),
-            "position",
-            DEFAULT_PANE_TOP_POSITION,
-            "Podcast Browser Pane Container Top Position",
-            "The position of the podcast browser pane container, when placed at the top"
-        );
-
         public static readonly SchemaEntry<int> PaneLeftPosition = new SchemaEntry<int> (
             String.Format ("{0}.{1}.browser.left", PersistentPaneController.NamespacePrefix, name),
             "position",
             DEFAULT_PANE_LEFT_POSITION,
-            "Podcast Browser Pane Container Left Position",
-            "The position of the podcast browser pane container, when placed on the left"
+            "Podcast Browser Pane Container Position",
+            "The position of the podcast browser pane container"
         );
 
-
-        public PodcastSourceContents () : base (name, PaneTopPosition, PaneLeftPosition)
+        public PodcastSourceContents () : base (name, SchemaEntry<int>.Zero, PaneLeftPosition)
         {
         }
 


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