[longomatch] Fix updating teams plays' list



commit 949e378ddc72b3df7dbae5c429dec3d418007bef
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Jan 26 08:28:25 2012 +0100

    Fix updating teams plays' list

 .../Gui/Component/PlayersListTreeWidget.cs         |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
index a0d3a0e..ad4e98a 100644
--- a/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/PlayersListTreeWidget.cs
@@ -62,24 +62,25 @@ namespace LongoMatch.Gui.Component
 			TreeStore team;
 			Dictionary<Player, TreeIter> playersDict = new Dictionary<Player, TreeIter>();
 			
+			Log.Debug("Updating teams models with template:" + template);
 			team = new TreeStore(typeof(object));
 
 			foreach(var player in template) {
 				/* Add a root in the tree with the option name */
 				var iter = team.AppendValues(player);
 				playersDict.Add(player, iter);
+				Log.Debug("Adding new player to the model: " + player);
 			}
 			
 			foreach (var play in plays) {
 				foreach (var player in play.Players.AllUniqueElements) {
-					if (playersDict.ContainsKey(player.Value))
+					if (playersDict.ContainsKey(player.Value)) {
 						team.AppendValues(playersDict[player.Value], new object[1] {play});
+						Log.Debug("Adding new play to player: " + player);
+					}
 				}
 			}
-		}
-
-		public void UpdatePlaysList(TreeStore model) {
-			playerstreeview.Model = model;
+			playerstreeview.Model = team;
 		}
 
 		public bool PlayListLoaded {



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