[f-spot] Slightly decouple ImportController from ImageFile.



commit 661ed12c129db08971ab38aed568929726f46a9a
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Jun 12 18:44:25 2010 +0200

    Slightly decouple ImportController from ImageFile.

 src/Import/ImportController.cs |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/Import/ImportController.cs b/src/Import/ImportController.cs
index 875e49b..71bb30a 100644
--- a/src/Import/ImportController.cs
+++ b/src/Import/ImportController.cs
@@ -291,7 +291,7 @@ namespace FSpot.Import
 
         void ImportPhoto (IBrowsableItem item, Roll roll)
         {
-            var destination = FindImportDestination (item.DefaultVersion.Uri);
+            var destination = FindImportDestination (item);
             string hash = String.Empty;
 
             // Do duplicate detection
@@ -334,17 +334,16 @@ namespace FSpot.Import
             imported_photos.Add (photo.Id);
         }
 
-        SafeUri FindImportDestination (SafeUri uri)
+        SafeUri FindImportDestination (IBrowsableItem item)
         {
+            var uri = item.DefaultVersion.Uri;
+
             if (!CopyFiles)
                 return uri; // Keep it at the same place
 
             // Find a new unique location inside the photo folder
             string name = uri.GetFilename ();
-            DateTime time;
-            using (FSpot.ImageFile img = FSpot.ImageFile.Create (uri)) {
-                time = img.Date;
-            }
+            DateTime time = item.Time;
 
             var dest_uri = Global.PhotoUri.Append (time.Year.ToString ())
                                           .Append (String.Format ("{0:D2}", time.Month))



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]