[chronojump] Fixed delete session now deletes all encoder and videos stuff
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Fixed delete session now deletes all encoder and videos stuff
- Date: Tue, 12 May 2015 13:52:32 +0000 (UTC)
commit 41ad309e5bc4e6640eb0ec884c7a86abadfb6021
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue May 12 15:52:08 2015 +0200
Fixed delete session now deletes all encoder and videos stuff
src/gui/chronojump.cs | 2 +-
src/sqlite/session.cs | 19 +++++++++----------
src/util.cs | 4 +++-
3 files changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/src/gui/chronojump.cs b/src/gui/chronojump.cs
index 545e396..4c61ba1 100644
--- a/src/gui/chronojump.cs
+++ b/src/gui/chronojump.cs
@@ -2535,7 +2535,7 @@ public partial class ChronoJumpWindow
private void on_delete_session_activate (object o, EventArgs args) {
- LogB.Information("delete session");
+ LogB.Information("--- delete session ---");
ConfirmWindow confirmWin = ConfirmWindow.Show(Catalog.GetString("Are you sure you want to
delete the current session"), "", Catalog.GetString("and all the session tests?"));
confirmWin.Button_accept.Clicked += new EventHandler(on_delete_session_accepted);
}
diff --git a/src/sqlite/session.cs b/src/sqlite/session.cs
index bc3a0f8..fa7e363 100644
--- a/src/sqlite/session.cs
+++ b/src/sqlite/session.cs
@@ -622,13 +622,9 @@ class SqliteSession : Sqlite
dbcmd.CommandText = "Delete FROM " + Constants.MultiChronopicTable + " WHERE sessionID == " +
uniqueID;
dbcmd.ExecuteNonQuery();
- //delete from encoder
- dbcmd.CommandText = "Delete FROM " + Constants.EncoderTable + " WHERE sessionID == " +
uniqueID;
-
- dbcmd.ExecuteNonQuery();
-
+ //delete from encoder start ------>
- //delete encoder signal and curves (and it's videos)
+ //signals
ArrayList encoderArray = SqliteEncoder.Select(
true, -1, -1, Convert.ToInt32(uniqueID), -1,
"signal", EncoderSQL.Eccons.ALL,
@@ -636,11 +632,12 @@ class SqliteSession : Sqlite
foreach(EncoderSQL eSQL in encoderArray) {
Util.FileDelete(eSQL.GetFullURL(false)); //signal, don't convertPathToR
- if(eSQL.future2 != "")
- Util.FileDelete(eSQL.future2); //video
+ if(eSQL.videoURL != "")
+ Util.FileDelete(eSQL.videoURL); //video
Sqlite.Delete(true, Constants.EncoderTable, Convert.ToInt32(eSQL.uniqueID));
}
+ //curves
encoderArray = SqliteEncoder.Select(
true, -1, -1, Convert.ToInt32(uniqueID), -1,
"curve", EncoderSQL.Eccons.ALL,
@@ -649,12 +646,14 @@ class SqliteSession : Sqlite
foreach(EncoderSQL eSQL in encoderArray) {
Util.FileDelete(eSQL.GetFullURL(false)); //don't convertPathToR
/* commented: curve has no video
- if(eSQL.future2 != "")
- Util.FileDelete(eSQL.future2);
+ if(eSQL.videoURL != "")
+ Util.FileDelete(eSQL.videoURL);
*/
Sqlite.Delete(true, Constants.EncoderTable, Convert.ToInt32(eSQL.uniqueID));
SqliteEncoder.DeleteSignalCurveWithCurveID(true, Convert.ToInt32(eSQL.uniqueID));
}
+
+ //<------- delete from encoder end
Sqlite.Close();
diff --git a/src/util.cs b/src/util.cs
index c3f22fd..5b0dc5f 100644
--- a/src/util.cs
+++ b/src/util.cs
@@ -997,7 +997,9 @@ public class Util
file.CopyTo(Path.Combine(target.FullName, file.Name));
}
- public static bool FileDelete(string fileName) {
+ public static bool FileDelete(string fileName)
+ {
+ LogB.Information("Checking if this filename exists: " + fileName);
try {
if(File.Exists(fileName)) {
LogB.Information("Deleting " + fileName + " ...");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]