[chronojump] Fixed import session if importing database has not forceSensor table
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed import session if importing database has not forceSensor table
- Date: Fri, 27 Sep 2019 09:13:40 +0000 (UTC)
commit 7d9bc92396f4d4efd0230acbfbdb885e9331559c
Author: Xavier de Blas <xaviblas gmail com>
Date: Fri Sep 27 11:13:17 2019 +0200
Fixed import session if importing database has not forceSensor table
src/sqlite/session.cs | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/sqlite/session.cs b/src/sqlite/session.cs
index 853c4ea6..4501ee32 100644
--- a/src/sqlite/session.cs
+++ b/src/sqlite/session.cs
@@ -580,19 +580,24 @@ class SqliteSession : Sqlite
reader_enc.Close();
//select force sensor of each session
- dbcmd.CommandText = "SELECT sessionID, count(*) FROM " + Constants.ForceSensorTable +
- " GROUP BY sessionID ORDER BY sessionID";
- LogB.SQL(dbcmd.CommandText.ToString());
- dbcmd.ExecuteNonQuery();
-
- SqliteDataReader reader_fs;
- reader_fs = dbcmd.ExecuteReader();
ArrayList myArray_fs = new ArrayList(2);
- while(reader_fs.Read()) {
- myArray_fs.Add (reader_fs[0].ToString() + ":" + reader_fs[1].ToString() + ":" );
+ //if we are importing from a session who was not the forceSensor table (db version < 1.68)
+ if(tableExists(true, Constants.ForceSensorTable))
+ {
+ dbcmd.CommandText = "SELECT sessionID, count(*) FROM " + Constants.ForceSensorTable +
+ " GROUP BY sessionID ORDER BY sessionID";
+ LogB.SQL(dbcmd.CommandText.ToString());
+ dbcmd.ExecuteNonQuery();
+
+ SqliteDataReader reader_fs;
+ reader_fs = dbcmd.ExecuteReader();
+
+ while(reader_fs.Read()) {
+ myArray_fs.Add (reader_fs[0].ToString() + ":" + reader_fs[1].ToString() + ":"
);
+ }
+ reader_fs.Close();
}
- reader_fs.Close();
//mix nine arrayLists
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]