[banshee] [ThickClient] Fix NRE in SourceView



commit 42b660ae41c0a0fd4dc32d3b8641e325a2d08dfb
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Sun Nov 14 13:05:11 2010 -0600

    [ThickClient] Fix NRE in SourceView
    
    Instead of inserting a node into the source model backing the TreeView
    and then setting each of its columns, insert it with its values so that
    the callbacks listening for new rows don't try to pull the
    not-initialized values.

 .../Banshee.Sources.Gui/SourceModel.cs             |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs
index 8c729f9..2190aa9 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Sources.Gui/SourceModel.cs
@@ -211,13 +211,10 @@ namespace Banshee.Sources.Gui
 
                 int position = source.Order;
 
+                var type = source is SourceManager.GroupSource ? EntryType.Group : EntryType.Source;
                 TreeIter iter = parent.Equals (TreeIter.Zero)
-                    ? InsertNode (position)
-                    : InsertNode (parent, position);
-
-                SetValue (iter, 0, source);
-                SetValue (iter, 1, source.Order);
-                SetValue (iter, 2, source is SourceManager.GroupSource ? EntryType.Group : EntryType.Source);
+                    ? InsertWithValues (position, source, source.Order, type)
+                    : InsertWithValues (parent, position, source, source.Order, type);
 
                 lock (source.Children) {
                     foreach (Source child in source.Children) {



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