[chronojump/michrolab] Fixed treeview (two levels) update since today commits



commit f51d2575a28911352c6b0515f11fef9644d141f9
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Sep 1 17:39:04 2022 +0200

    Fixed treeview (two levels) update since today commits

 src/treeview/event.cs | 47 ++++++++++++++++++++++++++++-------------------
 1 file changed, 28 insertions(+), 19 deletions(-)
---
diff --git a/src/treeview/event.cs b/src/treeview/event.cs
index de737d03e..d27bf9daa 100644
--- a/src/treeview/event.cs
+++ b/src/treeview/event.cs
@@ -229,27 +229,36 @@ public class TreeViewEvent
                                TreeIter iterDeep = new TreeIter ();
                                treeview.Model.IterChildren (out iterDeep, iter);
 
+                               string firstCol = treeview.Model.GetValue (iterDeep, 0).ToString ();
+                               if (firstCol.StartsWith (Catalog.GetString ("Total")))
+                               {
+                                       //do nothing as update right now only updates distance that makes 
change speed AVG
+                                       treeview.Model.IterNext (ref iterDeep);
+                                       firstCol = treeview.Model.GetValue (iterDeep, 0).ToString ();
+                               }
+
+                               if (firstCol.StartsWith (Catalog.GetString ("AVG")))
+                               {
+                                       myRow = printAVG (myEvent);
+                                       for (int i = 0; i < myRow.Length; i++)
+                                               store.SetValue (iterDeep, i, myRow[i]);
+
+                                       treeview.Model.IterNext (ref iterDeep);
+                                       firstCol = treeview.Model.GetValue (iterDeep, 0).ToString ();
+                               }
+
+                               if (firstCol.StartsWith (Catalog.GetString ("SD")))
+                               {
+                                       //do nothing as update right now only updates distance that makes 
change speed AVG
+                                       treeview.Model.IterNext (ref iterDeep);
+                                       firstCol = treeview.Model.GetValue (iterDeep, 0).ToString ();
+                               }
+
                                for (int j = 0; j < getNumOfSubEvents (myEvent); j++)
                                {
-                                       string firstCol = treeview.Model.GetValue (iterDeep, 0).ToString ();
-                                       if (
-                                                       firstCol.StartsWith (Catalog.GetString ("Total")) ||
-                                                       firstCol.StartsWith (Catalog.GetString ("SD")))
-                                       {
-                                               //do nothing as update right now only updates distance that 
makes change speed AVG
-                                       }
-                                       else if (firstCol.StartsWith (Catalog.GetString ("AVG")))
-                                       {
-                                               myRow = printAVG (myEvent);
-                                               for (int i = 0; i < myRow.Length; i++)
-                                                       store.SetValue (iterDeep, i, myRow[i]);
-                                       }
-                                       else
-                                       {
-                                               myRow = getSubLineToStore (myEvent, j);
-                                               for (int i = 0; i < myRow.Length; i++)
-                                                       store.SetValue (iterDeep, i, myRow[i]);
-                                       }
+                                       myRow = getSubLineToStore (myEvent, j);
+                                       for (int i = 0; i < myRow.Length; i++)
+                                               store.SetValue (iterDeep, i, myRow[i]);
 
                                        treeview.Model.IterNext (ref iterDeep);
                                }


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