[chronojump] encoderConfiguration.SelectActive creates one if there's no active
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] encoderConfiguration.SelectActive creates one if there's no active
- Date: Sun, 8 Jan 2017 11:58:13 +0000 (UTC)
commit ba6638b74580fb527afa4b69523b17986c68827c
Author: Xavier de Blas <xaviblas gmail com>
Date: Sun Jan 8 11:56:02 2017 +0100
encoderConfiguration.SelectActive creates one if there's no active
src/sqlite/encoderConfiguration.cs | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/sqlite/encoderConfiguration.cs b/src/sqlite/encoderConfiguration.cs
index 8d873cf..e3bfef4 100644
--- a/src/sqlite/encoderConfiguration.cs
+++ b/src/sqlite/encoderConfiguration.cs
@@ -184,7 +184,8 @@ class SqliteEncoderConfiguration : Sqlite
return list;
}
-
+
+ //if by any bug there's no active, then create default
public static EncoderConfigurationSQLObject SelectActive (Constants.EncoderGI encoderGI)
{
Sqlite.Open();
@@ -199,6 +200,7 @@ class SqliteEncoderConfiguration : Sqlite
EncoderConfigurationSQLObject econfSO = new EncoderConfigurationSQLObject();
+ bool success = false;
if(reader.Read())
{
string [] strFull = reader[4].ToString().Split(new char[] {':'});
@@ -215,8 +217,18 @@ class SqliteEncoderConfiguration : Sqlite
econf, //encoderConfiguration
reader[5].ToString() //description
);
+ success = true;
}
reader.Close();
+
+ //if by any bug there's no active, then create default and call himself again to select
+ if(! success)
+ {
+ insertDefault(encoderGI);
+ Sqlite.Close();
+ return SelectActive (encoderGI);
+ }
+
Sqlite.Close();
return econfSO;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]