[chronojump] Adding new bool to control SQL status... fixes SQL bug since last commits



commit b1dd4362591eacdfaedbe6c23ec3dd54844b000d
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 23 14:17:39 2015 +0200

    Adding new bool to control SQL status... fixes SQL bug since last commits

 src/sqlite/main.cs |    6 ++++++
 src/treeViewRun.cs |    4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 85a87a3..962362a 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -71,6 +71,8 @@ class Sqlite
        protected static int conversionSubRate;
        protected static int conversionSubRateTotal;
 
+       public static bool IsOpened = false;
+
        /*
         * Important, change this if there's any update to database
         */
@@ -106,11 +108,15 @@ class Sqlite
                        
                        LogB.SQL("-- end of catched --");
                }
+
+               IsOpened = true;
        }
        public static void Close()
        {
                LogB.SQLoff();
                dbcon.Close();
+               
+               IsOpened = false;
        }
 
        public static bool Connect()
diff --git a/src/treeViewRun.cs b/src/treeViewRun.cs
index d7d668f..cfd3b30 100644
--- a/src/treeViewRun.cs
+++ b/src/treeViewRun.cs
@@ -158,7 +158,7 @@ public class TreeViewRunsInterval : TreeViewRuns
                myRunI.Simulated = Convert.ToInt32(myStringOfData[12].ToString());
                //speed is not needed to define
                        
-               runType = SqliteRunIntervalType.SelectAndReturnRunIntervalType(myRunI.Type, false);
+               runType = SqliteRunIntervalType.SelectAndReturnRunIntervalType(myRunI.Type, Sqlite.IsOpened);
                
                return myRunI;
        }
@@ -198,7 +198,7 @@ public class TreeViewRunsInterval : TreeViewRuns
                int count = 0;
 
                if(newRunI.DistanceInterval == -1) {
-                       runType = SqliteRunIntervalType.SelectAndReturnRunIntervalType(newRunI.Type, false);
+                       runType = SqliteRunIntervalType.SelectAndReturnRunIntervalType(newRunI.Type, 
Sqlite.IsOpened);
                        myData[count++] = (lineCount + 1).ToString() +  
                                " (" + Util.GetRunIVariableDistancesStringRow(runType.DistancesString, 
lineCount).ToString() + "m)";
                        


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