[f-spot/rubenv-gsoc-2009: 7/86] Enforce the fact that one loader only loads one image.



commit 4fd202d9a5f9fff28e210ec3236a18bac30ab822
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sat Jul 18 11:55:14 2009 +0200

    Enforce the fact that one loader only loads one image.
    
    This will make the implementation of loaders much easier.

 src/Loaders/GdkImageLoader.cs    |    6 ++++++
 src/Loaders/LibrawImageLoader.cs |    4 ++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/Loaders/GdkImageLoader.cs b/src/Loaders/GdkImageLoader.cs
index 3095be3..4d9a24c 100644
--- a/src/Loaders/GdkImageLoader.cs
+++ b/src/Loaders/GdkImageLoader.cs
@@ -18,6 +18,8 @@ using FSpot.Platform;
 namespace FSpot.Loaders {
 	public class GdkImageLoader : Gdk.PixbufLoader, IImageLoader
 	{
+		Uri uri = null;
+
 #region public api
 		public GdkImageLoader () : base ()
 		{	
@@ -25,6 +27,10 @@ namespace FSpot.Loaders {
 
 		public void Load (Uri uri)
 		{
+			if (this.uri != null)
+				throw new Exception ("You should only request one image per loader!");
+			this.uri = uri;
+
 			if (is_disposed)
 				return;
 
diff --git a/src/Loaders/LibrawImageLoader.cs b/src/Loaders/LibrawImageLoader.cs
index 5177acb..3d07b81 100644
--- a/src/Loaders/LibrawImageLoader.cs
+++ b/src/Loaders/LibrawImageLoader.cs
@@ -16,9 +16,13 @@ using FSpot.Loaders.Native;
 
 namespace FSpot.Loaders {
 	public class LibrawImageLoader : IImageLoader {
+		Uri uri = null;
 
 		public void Load (Uri uri)
 		{
+			if (this.uri != null)
+				throw new Exception ("You should only request one image per loader!");
+			this.uri = uri;
 
 		}
 



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