[f-spot] Don't roll back on import failure.
- From: Ruben Vermeersch <rubenv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [f-spot] Don't roll back on import failure.
- Date: Sat, 7 Aug 2010 20:17:53 +0000 (UTC)
commit dd4215822c310c187045447ae9311adef4db150a
Author: Ruben Vermeersch <ruben savanne be>
Date: Sat Aug 7 22:15:13 2010 +0200
Don't roll back on import failure.
Rather, keep track of the failed URIs, observers can then show this list
to the user.
src/Import/ImportController.cs | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/Import/ImportController.cs b/src/Import/ImportController.cs
index 0abf1c9..db8ac49 100644
--- a/src/Import/ImportController.cs
+++ b/src/Import/ImportController.cs
@@ -28,6 +28,7 @@ namespace FSpot.Import
this.persist_preferences = persist_preferences;
Photos = new BrowsableCollectionProxy ();
+ FailedImports = new List<SafeUri> ();
LoadPreferences ();
}
@@ -150,6 +151,7 @@ namespace FSpot.Import
public int PhotosImported { get; private set; }
public Roll CreatedRoll { get; private set; }
+ public List<SafeUri> FailedImports { get; private set; }
#endregion
@@ -261,7 +263,13 @@ namespace FSpot.Import
}
ThreadAssist.ProxyToMain (() => ReportProgress (i++, total));
- ImportPhoto (info, CreatedRoll);
+ try {
+ ImportPhoto (info, CreatedRoll);
+ } catch (Exception e) {
+ Log.DebugFormat ("Failed to import {0}", info.DefaultVersion.Uri);
+ Log.DebugException (e);
+ FailedImports.Add (info.DefaultVersion.Uri);
+ }
}
PhotosImported = imported_photos.Count;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]