[longomatch] Fix a bit more the API to raise exceptions on failures
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix a bit more the API to raise exceptions on failures
- Date: Wed, 8 Oct 2014 00:12:33 +0000 (UTC)
commit 9b1e53cd1c2c55edeedbf52d029d7890526ea001
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Oct 6 18:01:17 2014 +0200
Fix a bit more the API to raise exceptions on failures
LongoMatch.Core/Interfaces/IDatabase.cs | 2 +-
LongoMatch.GUI/gtk-gui/gui.stetic | 1 -
LongoMatch.Services/Services/FileDB.cs | 36 +++++++++++-------------------
3 files changed, 14 insertions(+), 25 deletions(-)
---
diff --git a/LongoMatch.Core/Interfaces/IDatabase.cs b/LongoMatch.Core/Interfaces/IDatabase.cs
index 740349a..1569e3c 100644
--- a/LongoMatch.Core/Interfaces/IDatabase.cs
+++ b/LongoMatch.Core/Interfaces/IDatabase.cs
@@ -31,7 +31,7 @@ namespace LongoMatch.Core.Interfaces
bool RemoveProject(Guid id);
- bool UpdateProject(Project project);
+ void UpdateProject(Project project);
bool Exists(Project project);
diff --git a/LongoMatch.GUI/gtk-gui/gui.stetic b/LongoMatch.GUI/gtk-gui/gui.stetic
index d1ceb1b..ca6b2ed 100644
--- a/LongoMatch.GUI/gtk-gui/gui.stetic
+++ b/LongoMatch.GUI/gtk-gui/gui.stetic
@@ -5850,7 +5850,6 @@ You can continue with the current capture, cancel it or save your project.
<property name="MemberName" />
<property name="CanFocus">True</property>
<property name="Label" translatable="yes">Histogram</property>
- <property name="Active">True</property>
<property name="DrawIndicator">True</property>
<property name="HasLabel">True</property>
<property name="UseUnderline">True</property>
diff --git a/LongoMatch.Services/Services/FileDB.cs b/LongoMatch.Services/Services/FileDB.cs
index 9e66539..7284096 100644
--- a/LongoMatch.Services/Services/FileDB.cs
+++ b/LongoMatch.Services/Services/FileDB.cs
@@ -143,7 +143,6 @@ namespace LongoMatch.DB
public Project GetProject (Guid id)
{
- Project ret;
string projectFile = Path.Combine (dbDirPath, id.ToString ());
if (File.Exists (projectFile)) {
@@ -161,20 +160,16 @@ namespace LongoMatch.DB
{
string projectFile;
+ projectFile = Path.Combine (dbDirPath, project.ID.ToString ());
+ project.Description.LastModified = DateTime.UtcNow;
+ projectsDB.Add (project.Description);
try {
- projectFile = Path.Combine (dbDirPath, project.ID.ToString ());
- project.Description.LastModified = DateTime.UtcNow;
- projectsDB.Add (project.Description);
- try {
- if (File.Exists (projectFile))
- File.Delete (projectFile);
- Serializer.Save (project, projectFile);
- } catch (Exception ex) {
- Log.Exception (ex);
- projectsDB.Delete (project.Description.ID);
- }
+ if (File.Exists (projectFile))
+ File.Delete (projectFile);
+ Serializer.Save (project, projectFile);
} catch (Exception ex) {
- throw ex;
+ Log.Exception (ex);
+ projectsDB.Delete (project.Description.ID);
}
}
@@ -183,21 +178,16 @@ namespace LongoMatch.DB
string projectFile;
projectFile = Path.Combine (dbDirPath, id.ToString ());
- try {
- if (File.Exists (projectFile)) {
- File.Delete (projectFile);
- }
- return projectsDB.Delete (id);
- } catch (Exception ex) {
- Log.Exception (ex);
- return false;
+ if (File.Exists (projectFile)) {
+ File.Delete (projectFile);
}
+ return projectsDB.Delete (id);
}
- public bool UpdateProject (Project project)
+ public void UpdateProject (Project project)
{
project.Description.LastModified = DateTime.UtcNow;
- return AddProject (project);
+ AddProject (project);
}
void ReloadDB ()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]