[f-spot] Drop DefaultVersionUri.



commit c1588bd79240c37214f857263155e52c767cf120
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sun May 23 11:30:36 2010 +0200

    Drop DefaultVersionUri.
    
    Moving towards a concept where a photo has multiple versions. The
    default version can always be found by using DefaultVersion (which will
    never return null).
    
    This is reflected in IBrowsableItem and the new class
    IBrowsableItemVersion, in time these will become IPhoto and
    IPhotoVersion.

 extensions/Editors/ResizeEditor/ResizeEditor.cs    |    2 +-
 extensions/Exporters/CDExport/CDExport.cs          |    4 +-
 .../Exporters/FacebookExport/FacebookExport.cs     |    2 +-
 .../FacebookExport/FacebookExportDialog.cs         |    2 +-
 extensions/Exporters/FlickrExport/FlickrExport.cs  |    2 +-
 extensions/Exporters/FlickrExport/FlickrRemote.cs  |    2 +-
 extensions/Exporters/FolderExport/FolderExport.cs  |   10 +++---
 .../Exporters/GalleryExport/GalleryExport.cs       |    2 +-
 .../Exporters/GalleryExport/GalleryRemote.cs       |    4 +-
 .../Exporters/PicasaWebExport/PicasaWebExport.cs   |    2 +-
 .../Exporters/SmugMugExport/SmugMugExport.cs       |    2 +-
 extensions/Exporters/TabbloExport/TabbloExport.cs  |    6 ++--
 extensions/Exporters/ZipExport/ZipExport.cs        |    6 ++--
 extensions/Misc/LightTable/LightTable.cs           |    2 +-
 extensions/Services/DBusService/DBusProxy.cs       |    2 +-
 .../ChangePhotoPath/ChangePhotoPathController.cs   |    2 +-
 .../Tools/LiveWebGallery/PhotoRequestHandler.cs    |    6 ++--
 extensions/Tools/MetaPixel/MetaPixel.cs            |   14 ++++----
 extensions/Tools/PictureTile/PictureTile.cs        |    6 ++--
 lib/dpap-sharp/DPAPService/DPAPService.cs          |    6 ++--
 src/Core/IBrowsableItem.cs                         |    4 +-
 src/Core/IBrowsableItemExtensions.cs               |    2 +-
 src/Core/IBrowsableItemVersion.cs                  |   10 ++++++
 src/Core/Photo.cs                                  |    8 +----
 src/Core/PhotoVersion.cs                           |    8 ++--
 src/Editors/Editor.cs                              |    2 +-
 src/FileBrowsableItem.cs                           |   22 +++++++------
 src/FileImportBackend.cs                           |   31 +++++++++++++-------
 src/Jobs/SyncMetadataJob.cs                        |    4 +-
 src/MainWindow.cs                                  |   14 ++++----
 src/Makefile.am                                    |    1 +
 src/PhotoImageView.cs                              |    8 ++--
 src/PhotoLoader.cs                                 |    8 ++--
 src/PhotoStore.cs                                  |    2 +-
 src/PrintOperation.cs                              |    4 +-
 src/RotateCommand.cs                               |    8 ++--
 src/SendEmail.cs                                   |   10 +++---
 src/SingleView.cs                                  |    4 +-
 src/UI.Dialog/RepairDialog.cs                      |    2 +-
 src/Util.cs                                        |    4 +-
 src/Widgets/Filmstrip.cs                           |    6 ++--
 src/Widgets/IconView.cs                            |   18 ++++++------
 src/Widgets/ImageDisplay.cs                        |    4 +-
 src/Widgets/InfoBox.cs                             |    8 ++--
 src/Widgets/MetadataDisplay.cs                     |   10 +++---
 src/Widgets/PreviewPopup.cs                        |    2 +-
 src/Widgets/SlideShow.cs                           |    2 +-
 47 files changed, 154 insertions(+), 136 deletions(-)
---
diff --git a/extensions/Editors/ResizeEditor/ResizeEditor.cs b/extensions/Editors/ResizeEditor/ResizeEditor.cs
index e49f0b3..deedaeb 100644
--- a/extensions/Editors/ResizeEditor/ResizeEditor.cs
+++ b/extensions/Editors/ResizeEditor/ResizeEditor.cs
@@ -33,7 +33,7 @@ namespace FSpot.Addins.Editors {
 		public override Widget ConfigurationWidget ()
 		{
 			int max;
-			using (ImageFile img = ImageFile.Create (State.Items[0].DefaultVersionUri))
+			using (ImageFile img = ImageFile.Create (State.Items[0].DefaultVersion.Uri))
 				using (Pixbuf p = img.Load ())
 					max = Math.Max (p.Width, p.Height);
 
diff --git a/extensions/Exporters/CDExport/CDExport.cs b/extensions/Exporters/CDExport/CDExport.cs
index 2229dcc..9484e62 100644
--- a/extensions/Exporters/CDExport/CDExport.cs
+++ b/extensions/Exporters/CDExport/CDExport.cs
@@ -58,7 +58,7 @@ namespace FSpotCDExport {
 			System.IO.FileInfo file_info;
 
 			foreach (IBrowsableItem item in selection.Items) {
-				path = item.DefaultVersionUri.LocalPath;
+				path = item.DefaultVersion.Uri.LocalPath;
 				if (System.IO.File.Exists (path)) {
 					file_info = new System.IO.FileInfo (path);
 					total_size += file_info.Length;
@@ -207,7 +207,7 @@ namespace FSpotCDExport {
 				foreach (IBrowsableItem photo in selection.Items) {
 
 				//FIXME need to implement the uniquename as a filter
-					using (FilterRequest request = new FilterRequest (photo.DefaultVersionUri)) {
+					using (FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri)) {
 						if (rotate)
 							new OrientationFilter ().Convert (request);
 
diff --git a/extensions/Exporters/FacebookExport/FacebookExport.cs b/extensions/Exporters/FacebookExport/FacebookExport.cs
index b44db9f..66225b0 100644
--- a/extensions/Exporters/FacebookExport/FacebookExport.cs
+++ b/extensions/Exporters/FacebookExport/FacebookExport.cs
@@ -355,7 +355,7 @@ namespace FSpot.Exporter.Facebook
 					progress_dialog.ProgressText = string.Empty;
 					progress_dialog.Fraction = i / (double) items.Length;
 
-					FilterRequest request = new FilterRequest (item.DefaultVersionUri);
+					FilterRequest request = new FilterRequest (item.DefaultVersion.Uri);
 					filters.Convert (request);
 
 					file_info = new FileInfo (request.Current.LocalPath);
diff --git a/extensions/Exporters/FacebookExport/FacebookExportDialog.cs b/extensions/Exporters/FacebookExport/FacebookExportDialog.cs
index faf3b2f..ead8548 100644
--- a/extensions/Exporters/FacebookExport/FacebookExportDialog.cs
+++ b/extensions/Exporters/FacebookExport/FacebookExportDialog.cs
@@ -192,7 +192,7 @@ namespace FSpot.Exporter.Facebook
 				tag_image.Destroy ();
 			}
 
-			using (Gdk.Pixbuf data = PixbufUtils.ScaleToMaxSize (ThumbnailFactory.LoadThumbnail (item.DefaultVersionUri), 400, 400)) {
+			using (Gdk.Pixbuf data = PixbufUtils.ScaleToMaxSize (ThumbnailFactory.LoadThumbnail (item.DefaultVersion.Uri), 400, 400)) {
 				tag_image_height = data.Height;
 				tag_image_width = data.Width;
 				tag_image = new Gtk.Image (data);
diff --git a/extensions/Exporters/FlickrExport/FlickrExport.cs b/extensions/Exporters/FlickrExport/FlickrExport.cs
index 6bb4727..e82a73e 100644
--- a/extensions/Exporters/FlickrExport/FlickrExport.cs
+++ b/extensions/Exporters/FlickrExport/FlickrExport.cs
@@ -349,7 +349,7 @@ namespace FSpotFlickrExport {
 						Catalog.GetString ("{0} of {1}"), photo_index,
 						selection.Count);
 
-					info = new FileInfo (photo.DefaultVersionUri.LocalPath);
+					info = new FileInfo (photo.DefaultVersion.Uri.LocalPath);
 					FilterSet stack = new FilterSet ();
 					if (scale)
 						stack.Add (new ResizeFilter ((uint)size));
diff --git a/extensions/Exporters/FlickrExport/FlickrRemote.cs b/extensions/Exporters/FlickrExport/FlickrRemote.cs
index bb84d6e..ca1dfc7 100644
--- a/extensions/Exporters/FlickrExport/FlickrRemote.cs
+++ b/extensions/Exporters/FlickrExport/FlickrRemote.cs
@@ -137,7 +137,7 @@ public class FlickrRemote {
 		// FIXME flickr needs rotation
 		string  error_verbose;
 
-		using (FilterRequest request = new FilterRequest (photo.DefaultVersionUri)) {
+		using (FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri)) {
 
 			try {
 				string tags = null;
diff --git a/extensions/Exporters/FolderExport/FolderExport.cs b/extensions/Exporters/FolderExport/FolderExport.cs
index e707d18..a965e21 100644
--- a/extensions/Exporters/FolderExport/FolderExport.cs
+++ b/extensions/Exporters/FolderExport/FolderExport.cs
@@ -443,13 +443,13 @@ namespace FSpotFolderExport {
 
 		protected virtual string ImageName (int image_num)
 		{
-			return System.IO.Path.GetFileName(FileImportBackend.UniqueName(gallery_path, System.IO.Path.GetFileName (collection [image_num].DefaultVersionUri.LocalPath)).AbsolutePath);
+			return System.IO.Path.GetFileName(FileImportBackend.UniqueName(gallery_path, System.IO.Path.GetFileName (collection [image_num].DefaultVersion.Uri.LocalPath)).AbsolutePath);
 		}
 
 		public void ProcessImage (int image_num, FilterSet filter_set)
 		{
 			IBrowsableItem photo = collection [image_num];
-			string photo_path = photo.DefaultVersionUri.LocalPath;
+			string photo_path = photo.DefaultVersion.Uri.LocalPath;
 			string path;
 			ScaleRequest req;
 
@@ -458,7 +458,7 @@ namespace FSpotFolderExport {
 			MakeDir (SubdirPath (req.Name));
 			path = SubdirPath (req.Name, ImageName (image_num));
 
-			using (FilterRequest request = new FilterRequest (photo.DefaultVersionUri)) {
+			using (FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri)) {
 				filter_set.Convert (request);
 				if (request.Current.LocalPath == path)
 					request.Preserve(request.Current);
@@ -497,7 +497,7 @@ namespace FSpotFolderExport {
 							if (req.Name == "thumbs")
 								req_set.Add (new SharpFilter (0.1, 2, 5));
 						}
-						using (FilterRequest tmp_req = new FilterRequest (photo.DefaultVersionUri)) {
+						using (FilterRequest tmp_req = new FilterRequest (photo.DefaultVersion.Uri)) {
 							req_set.Convert (tmp_req);
 							MakeDir (SubdirPath (req.Name));
 							path = SubdirPath (req.Name, ImageName (image_num));
@@ -636,7 +636,7 @@ namespace FSpotFolderExport {
 		{
 			try {
 				for (int i = 0; i < collection.Count; i++)
-					CreateComments (collection [i].DefaultVersionUri.LocalPath, i);
+					CreateComments (collection [i].DefaultVersion.Uri.LocalPath, i);
 
 				Directory.SetLastWriteTimeUtc(gallery_path, collection [0].Time);
 			} catch (System.Exception e) {
diff --git a/extensions/Exporters/GalleryExport/GalleryExport.cs b/extensions/Exporters/GalleryExport/GalleryExport.cs
index 88c9ae4..dab651d 100644
--- a/extensions/Exporters/GalleryExport/GalleryExport.cs
+++ b/extensions/Exporters/GalleryExport/GalleryExport.cs
@@ -781,7 +781,7 @@ namespace G2Export {
 					progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} of {1}"), photo_index, items.Length);
 
 
-					FilterRequest req = new FilterRequest (item.DefaultVersionUri);
+					FilterRequest req = new FilterRequest (item.DefaultVersion.Uri);
 
 					filters.Convert (req);
 					try {
diff --git a/extensions/Exporters/GalleryExport/GalleryRemote.cs b/extensions/Exporters/GalleryExport/GalleryRemote.cs
index b93d663..6c35047 100644
--- a/extensions/Exporters/GalleryExport/GalleryRemote.cs
+++ b/extensions/Exporters/GalleryExport/GalleryRemote.cs
@@ -85,7 +85,7 @@ namespace GalleryRemote {
 
 		public void Add (FSpot.IBrowsableItem item)
 		{
-			Add (item, item.DefaultVersionUri.LocalPath);
+			Add (item, item.DefaultVersion.Uri.LocalPath);
 		}
 
 		public int Add (FSpot.IBrowsableItem item, string path)
@@ -95,7 +95,7 @@ namespace GalleryRemote {
 
 			return gallery.AddItem (this,
 					 path,
-					 Path.GetFileName (item.DefaultVersionUri.LocalPath),
+					 Path.GetFileName (item.DefaultVersion.Uri.LocalPath),
 					 item.Name,
 					 item.Description,
 					 true);
diff --git a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
index 4c12a69..ecd8842 100644
--- a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
+++ b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
@@ -662,7 +662,7 @@ namespace FSpotGoogleExport {
 					photo_index++;
 
 					PicasaPicture picture;
-					using (FilterRequest request = new FilterRequest (item.DefaultVersionUri)) {
+					using (FilterRequest request = new FilterRequest (item.DefaultVersion.Uri)) {
 						filters.Convert (request);
 						file_info = new FileInfo (request.Current.LocalPath);
 
diff --git a/extensions/Exporters/SmugMugExport/SmugMugExport.cs b/extensions/Exporters/SmugMugExport/SmugMugExport.cs
index 7c935ea..791057d 100644
--- a/extensions/Exporters/SmugMugExport/SmugMugExport.cs
+++ b/extensions/Exporters/SmugMugExport/SmugMugExport.cs
@@ -568,7 +568,7 @@ namespace FSpotSmugMugExport {
 					progress_dialog.Fraction = ((photo_index) / (double) items.Length);
 					photo_index++;
 
-					FilterRequest request = new FilterRequest (item.DefaultVersionUri);
+					FilterRequest request = new FilterRequest (item.DefaultVersion.Uri);
 
 					filters.Convert (request);
 
diff --git a/extensions/Exporters/TabbloExport/TabbloExport.cs b/extensions/Exporters/TabbloExport/TabbloExport.cs
index 6d05ba8..3c14deb 100644
--- a/extensions/Exporters/TabbloExport/TabbloExport.cs
+++ b/extensions/Exporters/TabbloExport/TabbloExport.cs
@@ -373,7 +373,7 @@ namespace FSpotTabbloExport {
 
 			PhotoStore photo_store = FSpot.App.Instance.Database.Photos;
 			FSpot.Photo photo = photo_store.GetByUri (
-					item.DefaultVersionUri);
+					item.DefaultVersion.Uri);
 			Debug.Assert (null != photo);
 			if (null == photo) {
 				return;
@@ -395,11 +395,11 @@ namespace FSpotTabbloExport {
 			FSpot.IBrowsableItem [] items = model.Photos;
 
 			for (int i = 0; i < pictures.Length; ++i) {
-				string mime_type = GLib.FileFactory.NewForUri (items [i].DefaultVersionUri).
+				string mime_type = GLib.FileFactory.NewForUri (items [i].DefaultVersion.Uri).
 							QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
 
 				pictures [i] = new Picture (items [i].Name,
-						items [i].DefaultVersionUri,
+						items [i].DefaultVersion.Uri,
 						mime_type,
 						model.Privacy);
 			}
diff --git a/extensions/Exporters/ZipExport/ZipExport.cs b/extensions/Exporters/ZipExport/ZipExport.cs
index 632faf1..ce386ca 100644
--- a/extensions/Exporters/ZipExport/ZipExport.cs
+++ b/extensions/Exporters/ZipExport/ZipExport.cs
@@ -115,17 +115,17 @@ namespace ZipExport {
 					FilterSet filters = new FilterSet ();
 					filters.Add (new JpegFilter ());
 					filters.Add (new ResizeFilter ((uint) scale_size.ValueAsInt));
-					FilterRequest freq = new FilterRequest (photos [i].DefaultVersionUri);
+					FilterRequest freq = new FilterRequest (photos [i].DefaultVersion.Uri);
 					filters.Convert (freq);
 					f = freq.Current.LocalPath;
 				} else {
-					f = photos [i].DefaultVersionUri.LocalPath;
+					f = photos [i].DefaultVersion.Uri.LocalPath;
 				}
 				FileStream fs = File.OpenRead (f);
 
 				byte [] buffer = new byte [fs.Length];
 				fs.Read (buffer, 0, buffer.Length);
-				ZipEntry entry = new ZipEntry (System.IO.Path.GetFileName (photos [i].DefaultVersionUri.LocalPath));
+				ZipEntry entry = new ZipEntry (System.IO.Path.GetFileName (photos [i].DefaultVersion.Uri.LocalPath));
 
 				entry.DateTime = DateTime.Now;
 
diff --git a/extensions/Misc/LightTable/LightTable.cs b/extensions/Misc/LightTable/LightTable.cs
index 9bed6b4..e2e80e4 100644
--- a/extensions/Misc/LightTable/LightTable.cs
+++ b/extensions/Misc/LightTable/LightTable.cs
@@ -70,7 +70,7 @@ namespace LightTableExtension
 				selected_photos = new List<MLPhoto> ();
 
 				foreach (Photo p in App.Instance.Organizer.SelectedPhotos ()) {
-					MLPhoto p1 = new MLPhoto (p.DefaultVersionUri, this);
+					MLPhoto p1 = new MLPhoto (p.DefaultVersion.Uri, this);
 					photos.Add (p1);
 				}
 
diff --git a/extensions/Services/DBusService/DBusProxy.cs b/extensions/Services/DBusService/DBusProxy.cs
index 5f5813a..aa8e586 100644
--- a/extensions/Services/DBusService/DBusProxy.cs
+++ b/extensions/Services/DBusService/DBusProxy.cs
@@ -323,7 +323,7 @@ namespace DBusService {
 			if (p == null)
 				throw new DBusException ("Photo with id {0} does not exist.", id);
 
-			dict.Add ("Uri", p.DefaultVersionUri.ToString());
+			dict.Add ("Uri", p.DefaultVersion.Uri.ToString());
 			dict.Add ("Id", p.Id);
 			dict.Add ("Name", p.Name);
 			dict.Add ("Description", p.Description ?? string.Empty);
diff --git a/extensions/Tools/ChangePhotoPath/ChangePhotoPathController.cs b/extensions/Tools/ChangePhotoPath/ChangePhotoPathController.cs
index 01d78be..87a9268 100644
--- a/extensions/Tools/ChangePhotoPath/ChangePhotoPathController.cs
+++ b/extensions/Tools/ChangePhotoPath/ChangePhotoPathController.cs
@@ -104,7 +104,7 @@ namespace ChangePhotoPath
 			string res_path = null;
 
 			foreach ( IBrowsableItem photo in photo_store.Query ( "SELECT * FROM photos " ) ) {
-				string tmp_path = (photo as Photo).DefaultVersionUri.AbsolutePath;
+				string tmp_path = (photo as Photo).DefaultVersion.Uri.AbsolutePath;
 				res_path = IsThisPhotoOnOrigBasePath (tmp_path);
 				if (res_path != null)
 					break;
diff --git a/extensions/Tools/LiveWebGallery/PhotoRequestHandler.cs b/extensions/Tools/LiveWebGallery/PhotoRequestHandler.cs
index 0885a60..991e932 100644
--- a/extensions/Tools/LiveWebGallery/PhotoRequestHandler.cs
+++ b/extensions/Tools/LiveWebGallery/PhotoRequestHandler.cs
@@ -36,7 +36,7 @@ namespace LiveWebGalleryExtension
 		
 		protected virtual void SendImage (Photo photo, Stream stream) 
 		{
-			string path = photo.DefaultVersionUri.LocalPath;
+			string path = photo.DefaultVersion.Uri.LocalPath;
 			FileInfo file_info = new FileInfo(path);
 			if (!file_info.Exists) {
 				SendError (stream, "404 The file is not on the disk");
@@ -48,7 +48,7 @@ namespace LiveWebGalleryExtension
 			filters.Add (new ResizeFilter (1600));
 			filters.Add (new OrientationFilter ());
 
-			using (FilterRequest request = new FilterRequest (photo.DefaultVersionUri)) {
+			using (FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri)) {
 				filters.Convert (request);
 				file_info = new FileInfo (request.Current.LocalPath);
 				SendFile (file_info, photo, stream);
@@ -82,7 +82,7 @@ namespace LiveWebGalleryExtension
 		
 		protected override void SendImage (Photo photo, Stream dest) 
 		{
-			Gdk.Pixbuf thumb = FSpot.Platform.ThumbnailFactory.LoadThumbnail (photo.DefaultVersionUri);
+			Gdk.Pixbuf thumb = FSpot.Platform.ThumbnailFactory.LoadThumbnail (photo.DefaultVersion.Uri);
 			byte[] buf = thumb.SaveToBuffer ("png");
 			SendHeadersAndStartContent(dest, "Content-Type: " + MimeTypeForExt (".png"),
 											 "Content-Length: " + buf.Length,
diff --git a/extensions/Tools/MetaPixel/MetaPixel.cs b/extensions/Tools/MetaPixel/MetaPixel.cs
index ffa1c4e..c2c5dc2 100644
--- a/extensions/Tools/MetaPixel/MetaPixel.cs
+++ b/extensions/Tools/MetaPixel/MetaPixel.cs
@@ -143,8 +143,8 @@ namespace MetaPixelExtension {
 					return;
 				}
 				//FIXME should switch to retry/skip
-				if (!GLib.FileFactory.NewForUri (p.DefaultVersionUri).Exists) {
-					Log.Warning (String.Format ("Couldn't access photo {0} while creating miniatures", p.DefaultVersionUri.LocalPath));
+				if (!GLib.FileFactory.NewForUri (p.DefaultVersion.Uri).Exists) {
+					Log.Warning (String.Format ("Couldn't access photo {0} while creating miniatures", p.DefaultVersion.Uri.LocalPath));
 					continue;
 				}
 				//FIXME Check if the picture's format is supproted (jpg, gif)
@@ -152,11 +152,11 @@ namespace MetaPixelExtension {
 				FilterSet filters = new FilterSet ();
 				filters.Add (new JpegFilter ());
 				filters.Add (new OrientationFilter ());
-				FilterRequest freq = new FilterRequest (p.DefaultVersionUri);
+				FilterRequest freq = new FilterRequest (p.DefaultVersion.Uri);
 				filters.Convert (freq);
 
 				//We use photo id for minis, instead of photo names, to avoid duplicates
-				string minifile = minidir_tmp + p.Id.ToString() + System.IO.Path.GetExtension (p.DefaultVersionUri.ToString ());
+				string minifile = minidir_tmp + p.Id.ToString() + System.IO.Path.GetExtension (p.DefaultVersion.Uri.ToString ());
 				string prepare_command = String.Format ("--prepare -w {0} -h {1} {2} {3} {4}tables.mxt",
 									icon_x_size.Text, //Minis width
 									icon_y_size.Text, //Minis height
@@ -190,8 +190,8 @@ namespace MetaPixelExtension {
 					return;
 				}
 				//FIXME should switch to retry/skip
-				if (!GLib.FileFactory.NewForUri (p.DefaultVersionUri).Exists) {
-					Log.Warning (String.Format ("Couldn't access photo {0} while creating mosaics", p.DefaultVersionUri.LocalPath));
+				if (!GLib.FileFactory.NewForUri (p.DefaultVersion.Uri).Exists) {
+					Log.Warning (String.Format ("Couldn't access photo {0} while creating mosaics", p.DefaultVersion.Uri.LocalPath));
 					error_count ++;
 					continue;
 				}
@@ -201,7 +201,7 @@ namespace MetaPixelExtension {
 				FilterSet filters = new FilterSet ();
 				filters.Add (new JpegFilter ());
 				filters.Add (new OrientationFilter ());
-				FilterRequest freq = new FilterRequest (p.DefaultVersionUri);
+				FilterRequest freq = new FilterRequest (p.DefaultVersion.Uri);
 				filters.Convert (freq);
 
 				string name = GetVersionName (p);
diff --git a/extensions/Tools/PictureTile/PictureTile.cs b/extensions/Tools/PictureTile/PictureTile.cs
index a4a3821..1e085c6 100644
--- a/extensions/Tools/PictureTile/PictureTile.cs
+++ b/extensions/Tools/PictureTile/PictureTile.cs
@@ -130,12 +130,12 @@ namespace PictureTileExtension {
 				}
 
 				//FIXME should switch to retry/skip
-				if (!GLib.FileFactory.NewForUri (p.DefaultVersionUri).Exists) {
-					Log.Warning (String.Format ("Couldn't access photo {0} while creating mosaics", p.DefaultVersionUri.LocalPath));
+				if (!GLib.FileFactory.NewForUri (p.DefaultVersion.Uri).Exists) {
+					Log.Warning (String.Format ("Couldn't access photo {0} while creating mosaics", p.DefaultVersion.Uri.LocalPath));
 					continue;
 				}
 
-				using (FilterRequest freq = new FilterRequest (p.DefaultVersionUri)) {
+				using (FilterRequest freq = new FilterRequest (p.DefaultVersion.Uri)) {
 					filters.Convert (freq);
 					File.Copy (freq.Current.LocalPath, String.Format ("{0}{1}.jpg", dir_tmp, counter ++));
 				}
diff --git a/lib/dpap-sharp/DPAPService/DPAPService.cs b/lib/dpap-sharp/DPAPService/DPAPService.cs
index 8d04893..4791c6f 100644
--- a/lib/dpap-sharp/DPAPService/DPAPService.cs
+++ b/lib/dpap-sharp/DPAPService/DPAPService.cs
@@ -70,15 +70,15 @@ namespace DPAP {
 				int i=0;
 
 				foreach (FSpot.Photo photo in photos) {
-					string thumbnail_path = Gnome.Thumbnail.PathForUri (photo.DefaultVersionUri.ToString(), Gnome.ThumbnailSize.Large);
+					string thumbnail_path = Gnome.Thumbnail.PathForUri (photo.DefaultVersion.Uri.ToString(), Gnome.ThumbnailSize.Large);
 					FileInfo f = new FileInfo (thumbnail_path);
 					DPAP.Photo p = new DPAP.Photo ();
 
 					p.FileName = photo.Name;
 					p.Thumbnail = thumbnail_path;
 					p.ThumbSize = (int)f.Length;
-					p.Path = photo.DefaultVersionUri.ToString ().Substring (7);
-					f = new FileInfo (photo.DefaultVersionUri.ToString ().Substring (7));
+					p.Path = photo.DefaultVersion.Uri.ToString ().Substring (7);
+					f = new FileInfo (photo.DefaultVersion.Uri.ToString ().Substring (7));
 					if (!f.Exists)
 						continue;
 
diff --git a/src/Core/IBrowsableItem.cs b/src/Core/IBrowsableItem.cs
index adc9024..72ce751 100644
--- a/src/Core/IBrowsableItem.cs
+++ b/src/Core/IBrowsableItem.cs
@@ -18,7 +18,7 @@ namespace FSpot
 			get;
 		}
 
-		System.Uri DefaultVersionUri {
+		IBrowsableItemVersion DefaultVersion {
 			get;
 		}
 
@@ -36,4 +36,4 @@ namespace FSpot
 	}
 
 
-}	
+}
diff --git a/src/Core/IBrowsableItemExtensions.cs b/src/Core/IBrowsableItemExtensions.cs
index 0b3f59a..ae88c0f 100644
--- a/src/Core/IBrowsableItemExtensions.cs
+++ b/src/Core/IBrowsableItemExtensions.cs
@@ -28,7 +28,7 @@ namespace FSpot
 
 		public static int CompareDefaultVersionUri (this IBrowsableItem photo1, IBrowsableItem photo2)
 		{
-			return string.Compare (photo1.DefaultVersionUri.ToString (), photo2.DefaultVersionUri.ToString ());
+			return string.Compare (photo1.DefaultVersion.Uri.ToString (), photo2.DefaultVersion.Uri.ToString ());
 		}
 	}
 }
diff --git a/src/Core/IBrowsableItemVersion.cs b/src/Core/IBrowsableItemVersion.cs
new file mode 100644
index 0000000..a4de7e4
--- /dev/null
+++ b/src/Core/IBrowsableItemVersion.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace FSpot
+{
+    public interface IBrowsableItemVersion {
+        string Name { get; }
+        bool IsProtected { get; }
+        Uri Uri { get; }
+    }
+}
diff --git a/src/Core/Photo.cs b/src/Core/Photo.cs
index 265cd7a..19fed7c 100644
--- a/src/Core/Photo.cs
+++ b/src/Core/Photo.cs
@@ -229,11 +229,7 @@ namespace FSpot
 			return null;
 		}
 		
-		public System.Uri DefaultVersionUri {
-			get { return VersionUri (DefaultVersionId); }
-		}
-	
-		public PhotoVersion DefaultVersion {
+		public IBrowsableItemVersion DefaultVersion {
 			get {
 				if (!Versions.ContainsKey (DefaultVersionId))
 					return null;
@@ -245,7 +241,7 @@ namespace FSpot
 		public uint SaveVersion (Gdk.Pixbuf buffer, bool create_version)
 		{
 			uint version = DefaultVersionId;
-			using (ImageFile img = ImageFile.Create (DefaultVersionUri)) {
+			using (ImageFile img = ImageFile.Create (DefaultVersion.Uri)) {
 				// Always create a version if the source is not a jpeg for now.
 				create_version = create_version || !(img is FSpot.JpegFile);
 	
diff --git a/src/Core/PhotoVersion.cs b/src/Core/PhotoVersion.cs
index 3f81a88..8593b02 100644
--- a/src/Core/PhotoVersion.cs
+++ b/src/Core/PhotoVersion.cs
@@ -12,9 +12,9 @@
 
 namespace FSpot
 {
-	public class PhotoVersion
+	public class PhotoVersion : IBrowsableItemVersion
 	{
-		Photo photo;
+		IBrowsableItem photo;
 		uint version_id;
 		System.Uri uri;
 		string md5_sum;
@@ -26,7 +26,7 @@ namespace FSpot
 			set { name = value; }
 		}
 	
-		public Photo Photo {
+		public IBrowsableItem Photo {
 			get { return photo; }
 		}
 	
@@ -52,7 +52,7 @@ namespace FSpot
 			get { return is_protected; }
 		}
 	
-		public PhotoVersion (Photo photo, uint version_id, System.Uri uri, string md5_sum, string name, bool is_protected)
+		public PhotoVersion (IBrowsableItem photo, uint version_id, System.Uri uri, string md5_sum, string name, bool is_protected)
 		{
 			this.photo = photo;
 			this.version_id = version_id;
diff --git a/src/Editors/Editor.cs b/src/Editors/Editor.cs
index 86f82d2..e751fae 100644
--- a/src/Editors/Editor.cs
+++ b/src/Editors/Editor.cs
@@ -98,7 +98,7 @@ namespace FSpot.Editors {
 
 		protected void LoadPhoto (Photo photo, out Pixbuf photo_pixbuf, out Cms.Profile photo_profile) {
 			// FIXME: We might get this value from the PhotoImageView.
-			using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri)) {
+			using (ImageFile img = ImageFile.Create (photo.DefaultVersion.Uri)) {
 				photo_pixbuf = img.Load ();
 				photo_profile = img.GetProfile ();
 			}
diff --git a/src/FileBrowsableItem.cs b/src/FileBrowsableItem.cs
index 709a586..e5f9500 100644
--- a/src/FileBrowsableItem.cs
+++ b/src/FileBrowsableItem.cs
@@ -19,23 +19,23 @@ namespace FSpot {
 	public class FileBrowsableItem : IBrowsableItem, IDisposable
 	{
 		ImageFile img;
-		Uri uri;
 		bool attempted;
 
 		public FileBrowsableItem (Uri uri)
 		{
-			this.uri = uri;
+			DefaultVersion = new FileBrowsableItemVersion () {
+                Uri = uri
+            };
 		}
 
-		public FileBrowsableItem (string path)
+		public FileBrowsableItem (string path) : this (UriUtils.PathToFileUri (path))
 		{
-			this.uri = UriUtils.PathToFileUri (path);
 		}
 
 		protected ImageFile Image {
 			get {
 				if (!attempted) {
-					img = ImageFile.Create (uri);
+					img = ImageFile.Create (DefaultVersion.Uri);
 					attempted = true;
 				}
 
@@ -55,11 +55,7 @@ namespace FSpot {
 			}
 		}
 
-		public Uri DefaultVersionUri {
-			get {
-				return uri;
-			}
-		}
+		public IBrowsableItemVersion DefaultVersion { get; private set; }
 
 		public string Description {
 			get {
@@ -92,5 +88,11 @@ namespace FSpot {
 			img.Dispose ();
 			GC.SuppressFinalize (this);
 		}
+
+		private class FileBrowsableItemVersion : IBrowsableItemVersion {
+			public string Name { get { return String.Empty; } }
+			public bool IsProtected { get { return true; } }
+			public Uri Uri { get; set; }
+		}
 	}
 }
diff --git a/src/FileImportBackend.cs b/src/FileImportBackend.cs
index e9338a2..93446e2 100644
--- a/src/FileImportBackend.cs
+++ b/src/FileImportBackend.cs
@@ -38,7 +38,10 @@ public class FileImportBackend : ImportBackend {
 	private class ImportInfo : IBrowsableItem {
 		public ImportInfo (Uri original)
 		{
-			DefaultVersionUri = original;
+			DefaultVersion = new ImportInfoVersion () {
+				Uri = original
+			};
+
 			try {
 				using (FSpot.ImageFile img = FSpot.ImageFile.Create (original)) {
 					Time = img.Date;
@@ -48,7 +51,7 @@ public class FileImportBackend : ImportBackend {
 			}
 		}
 
-		public System.Uri DefaultVersionUri { get; private set; }
+		public IBrowsableItemVersion DefaultVersion { get; private set; }
 		public System.Uri DestinationUri { get; set; }
 
 		public System.DateTime Time { get; private set; }
@@ -61,6 +64,12 @@ public class FileImportBackend : ImportBackend {
 		internal uint PhotoId { get; set; }
 	}
 
+	private class ImportInfoVersion : IBrowsableItemVersion {
+		public string Name { get { return String.Empty; } }
+		public bool IsProtected { get { return true; } }
+		public Uri Uri { get; set; }
+	}
+
 	public override List<IBrowsableItem> Prepare ()
 	{
 		if (import_info != null)
@@ -173,12 +182,12 @@ public class FileImportBackend : ImportBackend {
 		bool needs_commit = false;
 		bool abort = false;
 		try {
-			Uri destination = info.DefaultVersionUri;
+			Uri destination = info.DefaultVersion.Uri;
 			if (copy)
-				destination = ChooseLocation (info.DefaultVersionUri, directories);
+				destination = ChooseLocation (info.DefaultVersion.Uri, directories);
 
 			// Don't copy if we are already home
-			if (info.DefaultVersionUri == destination) {
+			if (info.DefaultVersion.Uri == destination) {
 				info.DestinationUri = destination;
 
 				if (detect_duplicates)
@@ -189,7 +198,7 @@ public class FileImportBackend : ImportBackend {
 				else
 				 	is_duplicate = true;
 			} else {
-				var file = GLib.FileFactory.NewForUri (info.DefaultVersionUri);
+				var file = GLib.FileFactory.NewForUri (info.DefaultVersion.Uri);
 				var new_file = GLib.FileFactory.NewForUri (destination);
 				file.Copy (new_file, GLib.FileCopyFlags.AllMetadata, null, null);
 				info.DestinationUri = destination;
@@ -200,7 +209,7 @@ public class FileImportBackend : ImportBackend {
 				if (photo == null)
 				{
 					photo = store.Create (info.DestinationUri,
-					                      info.DefaultVersionUri,
+					                      info.DefaultVersion.Uri,
 					                      roll.Id);
 				}
 				else
@@ -219,7 +228,7 @@ public class FileImportBackend : ImportBackend {
 					needs_commit = true;
 				}
 
-				needs_commit |= xmptags.Import (photo, info.DestinationUri, info.DefaultVersionUri);
+				needs_commit |= xmptags.Import (photo, info.DestinationUri, info.DefaultVersion.Uri);
 
 				if (needs_commit)
 					store.Commit(photo);
@@ -235,7 +244,7 @@ public class FileImportBackend : ImportBackend {
 									     Gtk.MessageType.Error,
 									     Gtk.ButtonsType.Cancel,
 									     Catalog.GetString ("Import error"),
-									     String.Format(Catalog.GetString ("Error importing {0}{2}{2}{1}"), info.DefaultVersionUri.ToString (), e.Message, Environment.NewLine ));
+									     String.Format(Catalog.GetString ("Error importing {0}{2}{2}{1}"), info.DefaultVersion.Uri.ToString (), e.Message, Environment.NewLine ));
 			errordialog.AddButton (Catalog.GetString ("Skip"), Gtk.ResponseType.Reject, false);
 			ResponseType response = (ResponseType) errordialog.Run ();
 			errordialog.Destroy ();
@@ -265,7 +274,7 @@ public class FileImportBackend : ImportBackend {
 		foreach (var item in import_info) {
             ImportInfo info = item as ImportInfo;
 			
-			if (info.DefaultVersionUri != info.DestinationUri && info.DestinationUri != null) {
+			if (info.DefaultVersion.Uri != info.DestinationUri && info.DestinationUri != null) {
 				try {
 					var file = GLib.FileFactory.NewForUri (info.DestinationUri);
 					if (file.QueryExists (null))
@@ -306,7 +315,7 @@ public class FileImportBackend : ImportBackend {
 
 		foreach (ImportInfo info in import_info) {
 			if (info.PhotoId != 0) 
-				FSpot.ThumbnailGenerator.Default.Request (store.Get (info.PhotoId).DefaultVersionUri, 0, 256, 256);
+				FSpot.ThumbnailGenerator.Default.Request (store.Get (info.PhotoId).DefaultVersion.Uri, 0, 256, 256);
 		}
 
 		import_info = null;
diff --git a/src/Jobs/SyncMetadataJob.cs b/src/Jobs/SyncMetadataJob.cs
index b0ceadd..409a62c 100644
--- a/src/Jobs/SyncMetadataJob.cs
+++ b/src/Jobs/SyncMetadataJob.cs
@@ -46,9 +46,9 @@ namespace FSpot.Jobs {
 		//FIXME: Won't work on non-file uris
 		void WriteMetadataToImage (Photo photo)
 		{
-			string path = photo.DefaultVersionUri.LocalPath;
+			string path = photo.DefaultVersion.Uri.LocalPath;
 	
-			using (FSpot.ImageFile img = FSpot.ImageFile.Create (photo.DefaultVersionUri)) {
+			using (FSpot.ImageFile img = FSpot.ImageFile.Create (photo.DefaultVersion.Uri)) {
 				if (img is FSpot.JpegFile) {
 					FSpot.JpegFile jimg = img as FSpot.JpegFile;
 				
diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index f36a27d..fbc928e 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -1069,7 +1069,7 @@ namespace FSpot
 	
 				bool use_icon = false;;
 				while (len-- > 0) {
-					FSpot.PixbufCache.CacheEntry entry = icon_view.Cache.Lookup (photos [len].DefaultVersionUri);
+					FSpot.PixbufCache.CacheEntry entry = icon_view.Cache.Lookup (photos [len].DefaultVersion.Uri);
 	
 					Pixbuf thumbnail = null;
 					if (entry != null) {
@@ -2381,8 +2381,8 @@ namespace FSpot
 						var paths = new List<string> ();
 						var uris = new List<string> ();
 						foreach (Photo p in SelectedPhotos ()) {
-							paths.Add (System.IO.Path.GetFullPath (p.DefaultVersionUri.LocalPath));
-							uris.Add (p.DefaultVersionUri.ToString ());
+							paths.Add (System.IO.Path.GetFullPath (p.DefaultVersion.Uri.LocalPath));
+							uris.Add (p.DefaultVersion.Uri.ToString ());
 						}
 						data.Text = String.Join (" ", paths.ToArray ());
 						data.SetUris (String.Join (" ", uris.ToArray ()));
@@ -2393,7 +2393,7 @@ namespace FSpot
 	
 			var pt = new List<string> ();
 			foreach (Photo p in SelectedPhotos ()) {
-				pt.Add (System.IO.Path.GetFullPath (p.DefaultVersionUri.LocalPath));
+				pt.Add (System.IO.Path.GetFullPath (p.DefaultVersion.Uri.LocalPath));
 			}
 			
 			primary.Text = String.Join (" ", pt.ToArray ());
@@ -2406,7 +2406,7 @@ namespace FSpot
 			if (current == null)
 				return;
 	
-			Desktop.SetBackgroundImage (current.DefaultVersionUri.LocalPath);
+			Desktop.SetBackgroundImage (current.DefaultVersion.Uri.LocalPath);
 		}
 	
 		void HandleSetDateRange (object sender, EventArgs args) {
@@ -2896,7 +2896,7 @@ namespace FSpot
 					errors.Add (new EditException (photo, ex));
 				}
 	
-				uri_list.Append (photo.DefaultVersionUri.ToString ());
+				uri_list.Append (photo.DefaultVersion.Uri.ToString ());
 			}
 	
 			// FIXME need to clean up the error dialog here.
@@ -3052,7 +3052,7 @@ namespace FSpot
 			foreach (Photo p in SelectedPhotos ()) {
 				string content;
 				try {
-					content = GLib.FileFactory.NewForUri (p.DefaultVersionUri).QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
+					content = GLib.FileFactory.NewForUri (p.DefaultVersion.Uri).QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null).ContentType;
 				} catch (GLib.GException) {
 					content = null;
 				}
diff --git a/src/Makefile.am b/src/Makefile.am
index e29786d..fb45295 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -33,6 +33,7 @@ CORE_CSDISTFILES =				\
 	$(srcdir)/Core/IBrowsableItemChanges.cs	\
 	$(srcdir)/Core/IBrowsableItemComparer.cs	\
 	$(srcdir)/Core/IBrowsableItemExtensions.cs	\
+	$(srcdir)/Core/IBrowsableItemVersion.cs	\
 	$(srcdir)/Core/IBrowsableCollection.cs	\
 	$(srcdir)/Core/PhotoChanges.cs		\
 	$(srcdir)/Core/PhotosChanges.cs		\
diff --git a/src/PhotoImageView.cs b/src/PhotoImageView.cs
index 5b968d4..d916ec1 100644
--- a/src/PhotoImageView.cs
+++ b/src/PhotoImageView.cs
@@ -289,7 +289,7 @@ namespace FSpot.Widgets {
 			    args.PreviousItem != null &&
 			    Item.IsValid &&
 			    (args.PreviousIndex != item.Index) &&
-			    (this.Item.Current.DefaultVersionUri == args.PreviousItem.DefaultVersionUri))
+			    (this.Item.Current.DefaultVersion.Uri == args.PreviousItem.DefaultVersion.Uri))
 				return;
 
 			// Don't reload if the image didn't change at all.
@@ -297,19 +297,19 @@ namespace FSpot.Widgets {
 			    !args.Changes.DataChanged &&
 			    args.PreviousItem != null &&
 			    Item.IsValid &&
-			    this.Item.Current.DefaultVersionUri == args.PreviousItem.DefaultVersionUri)
+			    this.Item.Current.DefaultVersion.Uri == args.PreviousItem.DefaultVersion.Uri)
 				return;
 
 			// Same image, don't load it progressively
 			if (args != null &&
 			    args.PreviousItem != null && 
 			    Item.IsValid && 
-			    Item.Current.DefaultVersionUri == args.PreviousItem.DefaultVersionUri)
+			    Item.Current.DefaultVersion.Uri == args.PreviousItem.DefaultVersion.Uri)
 				progressive_display = false;
 
 			try {
 				if (Item.IsValid) 
-					Load (Item.Current.DefaultVersionUri);
+					Load (Item.Current.DefaultVersion.Uri);
 				else
 					LoadErrorImage (null);
 			} catch (System.Exception e) {
diff --git a/src/PhotoLoader.cs b/src/PhotoLoader.cs
index ea10ce6..82b5156 100644
--- a/src/PhotoLoader.cs
+++ b/src/PhotoLoader.cs
@@ -20,7 +20,7 @@ namespace FSpot {
 
 		static public Gdk.Pixbuf Load (IBrowsableItem item) 
 		{
-			using (ImageFile img = ImageFile.Create (item.DefaultVersionUri)) {
+			using (ImageFile img = ImageFile.Create (item.DefaultVersion.Uri)) {
 				Gdk.Pixbuf pixbuf = img.Load ();
 				ValidateThumbnail (item, pixbuf);
 				return pixbuf;
@@ -29,16 +29,16 @@ namespace FSpot {
 
 		static public Gdk.Pixbuf LoadAtMaxSize (IBrowsableItem item, int width, int height) 
 		{
-			using (ImageFile img = ImageFile.Create (item.DefaultVersionUri)) {
+			using (ImageFile img = ImageFile.Create (item.DefaultVersion.Uri)) {
 				Gdk.Pixbuf pixbuf = img.Load (width, height);
-				ValidateThumbnail (item.DefaultVersionUri, pixbuf);
+				ValidateThumbnail (item.DefaultVersion.Uri, pixbuf);
 				return pixbuf;
 			}
 		}
 
 		static public Gdk.Pixbuf ValidateThumbnail (IBrowsableItem item, Gdk.Pixbuf pixbuf)
 		{
-			return ValidateThumbnail (item.DefaultVersionUri, pixbuf);
+			return ValidateThumbnail (item.DefaultVersion.Uri, pixbuf);
 		}
 
 		static public Gdk.Pixbuf ValidateThumbnail (System.Uri uri, Gdk.Pixbuf pixbuf)
diff --git a/src/PhotoStore.cs b/src/PhotoStore.cs
index 40ed244..89422eb 100644
--- a/src/PhotoStore.cs
+++ b/src/PhotoStore.cs
@@ -114,7 +114,7 @@ public class PhotoStore : DbStore<Photo> {
 
 		foreach (Photo match in md5_matches)
 		{
-			var file2 = GLib.FileFactory.NewForUri (match.DefaultVersionUri);
+			var file2 = GLib.FileFactory.NewForUri (match.DefaultVersion.Uri);
 			var info2 = file2.QueryInfo ("standard::content-type", GLib.FileQueryInfoFlags.None, null);
 
 			// same mimetype?
diff --git a/src/PrintOperation.cs b/src/PrintOperation.cs
index 2b29827..4be9d4a 100644
--- a/src/PrintOperation.cs
+++ b/src/PrintOperation.cs
@@ -110,7 +110,7 @@ namespace FSpot
 						DrawCropMarks (cr, x*w, y*h, w*.1);
 					if (x == ppx || y == ppy || p_index >= selected_photos.Length)
 						continue;
-					using (ImageFile img = new ImageFile (selected_photos[p_index].DefaultVersionUri))
+					using (ImageFile img = new ImageFile (selected_photos[p_index].DefaultVersion.Uri))
 					{
 						Gdk.Pixbuf pixbuf;
 						try {
@@ -119,7 +119,7 @@ namespace FSpot
 							if (FSpot.ColorManagement.Profiles.TryGetValue (Preferences.Get<string> (Preferences.COLOR_MANAGEMENT_OUTPUT_PROFILE), out printer_profile)) 
 								FSpot.ColorManagement.ApplyProfile (pixbuf, img.GetProfile (), printer_profile);
 						} catch (Exception e) {
-							Log.Exception ("Unable to load image " + selected_photos[p_index].DefaultVersionUri + "\n", e);
+							Log.Exception ("Unable to load image " + selected_photos[p_index].DefaultVersion.Uri + "\n", e);
 							// If the image is not found load error pixbuf
 							pixbuf = new Gdk.Pixbuf (PixbufUtils.ErrorPixbuf, 0, 0, 
 										      PixbufUtils.ErrorPixbuf.Width, 
diff --git a/src/RotateCommand.cs b/src/RotateCommand.cs
index d7c80ea..a1faf4b 100644
--- a/src/RotateCommand.cs
+++ b/src/RotateCommand.cs
@@ -124,7 +124,7 @@ namespace FSpot {
 			if (done)
 				return false;
 
- 			original_path = item.DefaultVersionUri.LocalPath;
+ 			original_path = item.DefaultVersion.Uri.LocalPath;
  			done = true;
 
 			if ((File.GetAttributes(original_path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
@@ -219,11 +219,11 @@ public class RotateCommand {
 			} catch (GLib.GException) {
 				readonly_count++;
 			} catch (DirectoryNotFoundException e) {
-				RunGenericError (e, op.Items [op.Index].DefaultVersionUri.LocalPath, Catalog.GetString ("Directory not found"));
+				RunGenericError (e, op.Items [op.Index].DefaultVersion.Uri.LocalPath, Catalog.GetString ("Directory not found"));
 			} catch (FileNotFoundException e) {
-				RunGenericError (e, op.Items [op.Index].DefaultVersionUri.LocalPath, Catalog.GetString ("File not found"));
+				RunGenericError (e, op.Items [op.Index].DefaultVersion.Uri.LocalPath, Catalog.GetString ("File not found"));
 			} catch (Exception e) {
-				RunGenericError (e, op.Items [op.Index].DefaultVersionUri.LocalPath);
+				RunGenericError (e, op.Items [op.Index].DefaultVersion.Uri.LocalPath);
 			}
 			index ++;
 		}
diff --git a/src/SendEmail.cs b/src/SendEmail.cs
index 29ce5d1..5b8f085 100644
--- a/src/SendEmail.cs
+++ b/src/SendEmail.cs
@@ -58,7 +58,7 @@ namespace FSpot {
 
 			for (int i = 0; i < selection.Count; i++) {
 				Photo p = selection[i] as Photo;
-				if (FileFactory.NewForUri (p.DefaultVersionUri).QueryInfo ("standard::content-type", FileQueryInfoFlags.None, null).ContentType != "image/jpeg")
+				if (FileFactory.NewForUri (p.DefaultVersion.Uri).QueryInfo ("standard::content-type", FileQueryInfoFlags.None, null).ContentType != "image/jpeg")
 					force_original = true;
 			}
 
@@ -91,7 +91,7 @@ namespace FSpot {
 			for (int i = 0; i < selection.Count; i++) {
 				Photo photo = selection[i] as Photo;
 				try {
-					Orig_Photo_Size += FileFactory.NewForUri (photo.DefaultVersionUri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
+					Orig_Photo_Size += FileFactory.NewForUri (photo.DefaultVersion.Uri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
 				} catch {
 				}
 			}
@@ -105,12 +105,12 @@ namespace FSpot {
 			if (scalephoto != null && !force_original) {
 				
 				// Get first photos file size
-				long orig_size = FileFactory.NewForUri (scalephoto.DefaultVersionUri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
+				long orig_size = FileFactory.NewForUri (scalephoto.DefaultVersion.Uri).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
 				
 				FilterSet filters = new FilterSet ();
 				filters.Add (new ResizeFilter ((uint)(sizes [3])));
 				long new_size;
-				using (FilterRequest request = new FilterRequest (scalephoto.DefaultVersionUri)) {
+				using (FilterRequest request = new FilterRequest (scalephoto.DefaultVersion.Uri)) {
 					filters.Convert (request);
 					new_size = FileFactory.NewForUri (request.Current).QueryInfo ("standard::size", FileQueryInfoFlags.None, null).Size;
 				}
@@ -276,7 +276,7 @@ namespace FSpot {
 					 	
 					try {
 						// Prepare a tmp_mail file name
-						FilterRequest request = new FilterRequest (photo.DefaultVersionUri);
+						FilterRequest request = new FilterRequest (photo.DefaultVersion.Uri);
 
 						filters.Convert (request);
 						request.Preserve(request.Current);
diff --git a/src/SingleView.cs b/src/SingleView.cs
index c56f61e..9c7d628 100644
--- a/src/SingleView.cs
+++ b/src/SingleView.cs
@@ -280,7 +280,7 @@ namespace FSpot {
 			if (current == null)
 				return;
 
-			Desktop.SetBackgroundImage (current.DefaultVersionUri.LocalPath);
+			Desktop.SetBackgroundImage (current.DefaultVersion.Uri.LocalPath);
 		}
 
 		private void HandleViewToolbar (object sender, System.EventArgs args)
@@ -462,7 +462,7 @@ namespace FSpot {
 			IBrowsableItem item = image_view.Item.Current;
 			System.Text.StringBuilder sb = new System.Text.StringBuilder();
 			if (filenames_item.Active && item != null)
-				sb.Append (System.IO.Path.GetFileName (item.DefaultVersionUri.LocalPath) + "  -  ");
+				sb.Append (System.IO.Path.GetFileName (item.DefaultVersion.Uri.LocalPath) + "  -  ");
 
 			sb.AppendFormat (Catalog.GetPluralString ("{0} Photo", "{0} Photos", collection.Count), collection.Count);
 			status_label.Text = sb.ToString ();
diff --git a/src/UI.Dialog/RepairDialog.cs b/src/UI.Dialog/RepairDialog.cs
index eec6802..b004dd1 100644
--- a/src/UI.Dialog/RepairDialog.cs
+++ b/src/UI.Dialog/RepairDialog.cs
@@ -41,7 +41,7 @@ namespace FSpot.UI.Dialog
 
 			for (i = 0; i < source.Count; i++) {
 				IBrowsableItem item = source [i];
-				string path = item.DefaultVersionUri.LocalPath;
+				string path = item.DefaultVersion.Uri.LocalPath;
 				if (! File.Exists (path) || (new FileInfo (path).Length == 0))
 					missing.Add (item);
 			}
diff --git a/src/Util.cs b/src/Util.cs
index 31af04d..d934fbb 100644
--- a/src/Util.cs
+++ b/src/Util.cs
@@ -24,7 +24,7 @@ namespace FSpot.Utils
 			foreach (FSpot.IBrowsableItem p in photos) {
 				Uri uri;
 				try {
-					uri = p.DefaultVersionUri;
+					uri = p.DefaultVersion.Uri;
 				} catch {
 					continue;
 				}
@@ -115,7 +115,7 @@ namespace FSpot.Utils
 	
 		public void Add (FSpot.IBrowsableItem item)
 		{
-			Add (item.DefaultVersionUri);
+			Add (item.DefaultVersion.Uri);
 		}
 	
 		public override string ToString () {
diff --git a/src/Widgets/Filmstrip.cs b/src/Widgets/Filmstrip.cs
index f6967cf..acf322d 100644
--- a/src/Widgets/Filmstrip.cs
+++ b/src/Widgets/Filmstrip.cs
@@ -541,7 +541,7 @@ namespace FSpot.Widgets
 			if (!args.Changes.DataChanged)
 				return;
 			foreach (int item in args.Items)
-				thumb_cache.TryRemove ((selection.Collection [item]).DefaultVersionUri);
+				thumb_cache.TryRemove ((selection.Collection [item]).DefaultVersion.Uri);
 
 			//FIXME call QueueDrawArea
 			QueueDraw ();
@@ -612,7 +612,7 @@ namespace FSpot.Widgets
  		protected virtual Pixbuf GetPixbuf (int i, bool highlighted)
 		{
 			Pixbuf current;
-			Uri uri = (selection.Collection [i]).DefaultVersionUri;
+			Uri uri = (selection.Collection [i]).DefaultVersion.Uri;
 			try {
 				current = PixbufUtils.ShallowCopy (thumb_cache.Get (uri));
 			} catch (IndexOutOfRangeException) {
@@ -621,7 +621,7 @@ namespace FSpot.Widgets
 
 			if (current == null) {
 				try {
-					ThumbnailGenerator.Default.Request ((selection.Collection [i]).DefaultVersionUri, 0, 256, 256);
+					ThumbnailGenerator.Default.Request ((selection.Collection [i]).DefaultVersion.Uri, 0, 256, 256);
 
 					if (SquaredThumbs) {
 						using (Pixbuf p = ThumbnailFactory.LoadThumbnail (uri)) {
diff --git a/src/Widgets/IconView.cs b/src/Widgets/IconView.cs
index 2874e3a..b2db3c4 100644
--- a/src/Widgets/IconView.cs
+++ b/src/Widgets/IconView.cs
@@ -565,7 +565,7 @@ namespace FSpot.Widgets
 		public void UpdateThumbnail (int thumbnail_num)
 		{
 			FSpot.IBrowsableItem photo = collection [thumbnail_num];
-			cache.Remove (photo.DefaultVersionUri);
+			cache.Remove (photo.DefaultVersion.Uri);
 			InvalidateCell (thumbnail_num);
 		}
 
@@ -773,9 +773,9 @@ namespace FSpot.Widgets
 
 			FSpot.IBrowsableItem photo = collection [thumbnail_num];
 
-			FSpot.PixbufCache.CacheEntry entry = cache.Lookup (photo.DefaultVersionUri);
+			FSpot.PixbufCache.CacheEntry entry = cache.Lookup (photo.DefaultVersion.Uri);
 			if (entry == null)
-				cache.Request (photo.DefaultVersionUri, thumbnail_num, ThumbnailWidth, ThumbnailHeight);
+				cache.Request (photo.DefaultVersion.Uri, thumbnail_num, ThumbnailWidth, ThumbnailHeight);
 			else
 				entry.Data = thumbnail_num;
 
@@ -938,7 +938,7 @@ namespace FSpot.Widgets
 
 			if (DisplayFilenames) {
 
-				string filename = System.IO.Path.GetFileName (photo.DefaultVersionUri.LocalPath);
+				string filename = System.IO.Path.GetFileName (photo.DefaultVersion.Uri.LocalPath);
 				Pango.Layout layout = new Pango.Layout (this.PangoContext);
 				layout.SetText (filename);
 
@@ -1182,16 +1182,16 @@ namespace FSpot.Widgets
 
 				photo = collection [cell];
 
-				entry = cache.Lookup (photo.DefaultVersionUri);
+				entry = cache.Lookup (photo.DefaultVersion.Uri);
 				if (entry == null)
-					cache.Request (photo.DefaultVersionUri, cell, ThumbnailWidth, ThumbnailHeight);
+					cache.Request (photo.DefaultVersion.Uri, cell, ThumbnailWidth, ThumbnailHeight);
 
 				cell = back ? scell + i : scell + mid - i - 1;
 				photo = collection [cell];
 
-				entry = cache.Lookup (photo.DefaultVersionUri);
+				entry = cache.Lookup (photo.DefaultVersion.Uri);
 				if (entry == null)
-					cache.Request (photo.DefaultVersionUri, cell, ThumbnailWidth, ThumbnailHeight);
+					cache.Request (photo.DefaultVersion.Uri, cell, ThumbnailWidth, ThumbnailHeight);
 			}
 		}
 
@@ -1283,7 +1283,7 @@ namespace FSpot.Widgets
 			int order = (int) entry.Data;
 
 			if (order >= 0 && order < collection.Count) {
-				System.Uri uri = collection [order].DefaultVersionUri;
+				System.Uri uri = collection [order].DefaultVersion.Uri;
 
 				if (result == null && !ThumbnailFactory.ThumbnailExists (uri))
 					FSpot.ThumbnailGenerator.Default.Request (uri, 0, 256, 256);
diff --git a/src/Widgets/ImageDisplay.cs b/src/Widgets/ImageDisplay.cs
index 7429656..27fc5fa 100644
--- a/src/Widgets/ImageDisplay.cs
+++ b/src/Widgets/ImageDisplay.cs
@@ -52,9 +52,9 @@ namespace FSpot.Widgets {
 		{
 			this.item = item;
 			CanFocus = true;
-			current = new ImageInfo (item.Current.DefaultVersionUri);
+			current = new ImageInfo (item.Current.DefaultVersion.Uri);
 			if (item.Collection.Count > item.Index + 1) {
-				next = new ImageInfo (item.Collection [item.Index + 1].DefaultVersionUri);
+				next = new ImageInfo (item.Collection [item.Index + 1].DefaultVersion.Uri);
 			}
 			delay = new Delay (30, new GLib.IdleHandler (DrawFrame));
 		}
diff --git a/src/Widgets/InfoBox.cs b/src/Widgets/InfoBox.cs
index 4595db2..2afb56f 100644
--- a/src/Widgets/InfoBox.cs
+++ b/src/Widgets/InfoBox.cs
@@ -493,7 +493,7 @@ namespace FSpot.Widgets
 			
 			try {
 				//using (new Timer ("building info")) {
-					using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri))
+					using (ImageFile img = ImageFile.Create (photo.DefaultVersion.Uri))
 					{
 						info = new ImageInfo (img);
 					}
@@ -568,7 +568,7 @@ namespace FSpot.Widgets
 
 			if (show_file_size) {
 				try {
-					GFile file = FileFactory.NewForUri (photo.DefaultVersionUri);
+					GFile file = FileFactory.NewForUri (photo.DefaultVersion.Uri);
 					GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
 					file_size_value_label.Text = Format.SizeForDisplay (file_info.Size);
 				} catch (GLib.GException e) {
@@ -655,7 +655,7 @@ namespace FSpot.Widgets
 				foreach (Photo photo in Photos) {
 					
 					try {
-						GFile file = FileFactory.NewForUri (photo.DefaultVersionUri);
+						GFile file = FileFactory.NewForUri (photo.DefaultVersion.Uri);
 						GFileInfo file_info = file.QueryInfo ("standard::size", FileQueryInfoFlags.None, null);
 						file_size += file_info.Size;
 					} catch (GLib.GException e) {
@@ -706,7 +706,7 @@ namespace FSpot.Widgets
 
 			try {
 				if (hint == null)
-					using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri))
+					using (ImageFile img = ImageFile.Create (photo.DefaultVersion.Uri))
 						hint = img.Load (256, 256);
 				
 				histogram_image.Pixbuf = histogram.Generate (hint, max);
diff --git a/src/Widgets/MetadataDisplay.cs b/src/Widgets/MetadataDisplay.cs
index cb7cc5f..1d21776 100644
--- a/src/Widgets/MetadataDisplay.cs
+++ b/src/Widgets/MetadataDisplay.cs
@@ -131,8 +131,8 @@ namespace FSpot.Widgets {
 				}
 
 				if (photo != null) {
-					if (File.Exists (photo.DefaultVersionUri.LocalPath))
-						exif_info = new Exif.ExifData (photo.DefaultVersionUri.LocalPath);
+					if (File.Exists (photo.DefaultVersion.Uri.LocalPath))
+						exif_info = new Exif.ExifData (photo.DefaultVersion.Uri.LocalPath);
 				} else {
 					exif_info = null;
 				}
@@ -329,7 +329,7 @@ namespace FSpot.Widgets {
 			if (photo != null) {
 				MetadataStore store = new MetadataStore ();
 				try {
-					using (ImageFile img = ImageFile.Create (photo.DefaultVersionUri)) {
+					using (ImageFile img = ImageFile.Create (photo.DefaultVersion.Uri)) {
 						if (img is SemWeb.StatementSource) {
 							StatementSource source = (StatementSource)img;
 							source.Select (store);
@@ -339,7 +339,7 @@ namespace FSpot.Widgets {
 					missing = true;
 				} catch (System.Exception e){
 					// Sometimes we don't get the right exception, check for the file
-					if (!System.IO.File.Exists (photo.DefaultVersionUri.LocalPath)) {
+					if (!System.IO.File.Exists (photo.DefaultVersion.Uri.LocalPath)) {
 						missing = true;
 					} else {
 						// if the file is there but we still got an exception display it.
@@ -412,7 +412,7 @@ namespace FSpot.Widgets {
 				     msg = Catalog.GetString ("No active photo");
 				} else if (missing) {
 					msg = String.Format (Catalog.GetString ("The photo \"{0}\" does not exist"),
-					                                        photo.DefaultVersionUri);
+					                                        photo.DefaultVersion.Uri);
 				} else {
 				     msg = Catalog.GetString ("No metadata available");
 
diff --git a/src/Widgets/PreviewPopup.cs b/src/Widgets/PreviewPopup.cs
index 10ef8c1..25a965a 100644
--- a/src/Widgets/PreviewPopup.cs
+++ b/src/Widgets/PreviewPopup.cs
@@ -106,7 +106,7 @@ namespace FSpot {
 		{
 			FSpot.IBrowsableItem item = view.Collection [Item];
 			
-			string orig_path = item.DefaultVersionUri.LocalPath;
+			string orig_path = item.DefaultVersion.Uri.LocalPath;
 
 			Gdk.Pixbuf pixbuf = PixbufUtils.ShallowCopy (preview_cache.Get (orig_path + show_histogram.ToString ()));
 			if (pixbuf == null) {
diff --git a/src/Widgets/SlideShow.cs b/src/Widgets/SlideShow.cs
index b77259d..f6d9d22 100644
--- a/src/Widgets/SlideShow.cs
+++ b/src/Widgets/SlideShow.cs
@@ -113,7 +113,7 @@ namespace FSpot.Widgets
 				if (item == null || item.Current == null)
 					return;
 
-				using (ImageFile img = ImageFile.Create (item.Current.DefaultVersionUri)) {
+				using (ImageFile img = ImageFile.Create (item.Current.DefaultVersion.Uri)) {
 					try {
 						using (var pb =  img.Load ()) {
 							double scale = Math.Min ((double)Allocation.Width/(double)pb.Width, (double)Allocation.Height/(double)pb.Height);



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