[f-spot: 1/3] removing of some Obsolete marked stuff, which causes no bigger changes



commit 3c27a399700c11544deeb501c0bd0703faebd2ee
Author: Mike Gemünde <mike gemuende de>
Date:   Fri Jul 3 19:41:28 2009 +0200

    removing of some Obsolete marked stuff, which causes no bigger changes
    
    removing of some Obsolete marked stuff, which causes no bigger changes
    
    removing of some Obsolete marked stuff, which causes no bigger changes
    
    remove commented method
    
    dummy

 src/Core/Photo.cs         |    8 ++--
 src/FileImportBackend.cs  |    7 +++-
 src/Loupe.cs              |   11 +------
 src/MainWindow.cs         |   15 +-------
 src/PhotoLoader.cs        |    7 ----
 src/PhotoStore.cs         |   37 +--------------------
 src/Preferences.cs        |   19 -----------
 src/RotateCommand.cs      |    2 +-
 src/ThumbnailGenerator.cs |    6 ---
 src/Utils/Log.cs          |   79 ++++++++++++--------------------------------
 10 files changed, 36 insertions(+), 155 deletions(-)
---
diff --git a/src/Core/Photo.cs b/src/Core/Photo.cs
index 61a331a..8181e18 100644
--- a/src/Core/Photo.cs
+++ b/src/Core/Photo.cs
@@ -349,13 +349,13 @@ namespace FSpot
 					version = CreateDefaultModifiedVersion (DefaultVersionId, false);
 	
 				try {
-					string version_path = VersionUri (version).LocalPath;
-				
-					using (Stream stream = System.IO.File.OpenWrite (version_path)) {
+					Uri versionUri = VersionUri (version);
+
+					using (Stream stream = System.IO.File.OpenWrite (versionUri.LocalPath)) {
 						img.Save (buffer, stream);
 					}
 					(GetVersion (version) as PhotoVersion).MD5Sum = GenerateMD5 (VersionUri (version));
-					FSpot.ThumbnailGenerator.Create (version_path).Dispose ();
+					FSpot.ThumbnailGenerator.Create (versionUri).Dispose ();
 					DefaultVersionId = version;
 				} catch (System.Exception e) {
 					System.Console.WriteLine (e);
diff --git a/src/FileImportBackend.cs b/src/FileImportBackend.cs
index 194072b..a52bd6f 100644
--- a/src/FileImportBackend.cs
+++ b/src/FileImportBackend.cs
@@ -222,7 +222,7 @@ public class FileImportBackend : ImportBackend {
 					photo = store.CheckForDuplicate (UriUtils.PathToFileUri (destination));
 
 				if (photo == null)
-					photo = store.Create (info.DestinationPath, roll.Id, out thumbnail);
+					photo = store.Create (UriUtils.PathToFileUri (info.DestinationPath), roll.Id, out thumbnail);
 				else
 				 	is_duplicate = true;
 			} else {
@@ -234,7 +234,10 @@ public class FileImportBackend : ImportBackend {
 
 				if (photo == null)
 				{
-					photo = store.Create (info.DestinationPath, info.OriginalPath, roll.Id, out thumbnail);
+					photo = store.Create (UriUtils.PathToFileUri (info.DestinationPath),
+					                      UriUtils.PathToFileUri (info.OriginalPath),
+					                      roll.Id,
+					                      out thumbnail);
 				 	
 
 					try {
diff --git a/src/Loupe.cs b/src/Loupe.cs
index a85d993..34ae14b 100644
--- a/src/Loupe.cs
+++ b/src/Loupe.cs
@@ -317,7 +317,7 @@ namespace FSpot.Widgets {
 	        static void SetSourcePixbuf (Context ctx, Gdk.Pixbuf pixbuf, double x, double y) 	 
 	        { 	 
 	                gdk_cairo_set_source_pixbuf (ctx.Handle, pixbuf.Handle, x, y); 	 
-	        } 	 
+	        }	 
 #endif				
 
 		protected override bool OnExposeEvent (Gdk.EventExpose args)
@@ -335,15 +335,6 @@ namespace FSpot.Widgets {
 
 		}
 		
-//                [DllImport ("libcairo-2.dll")]
-//                static extern void cairo_user_to_device (IntPtr cr, ref double x, ref double y);
-//
-//		private static void UserToDevice (Context ctx, ref double x, ref double y)
-//		{
-//			cairo_user_to_device (ctx.Handle, ref x, ref y);
-//		}
-
-		
 		bool dragging = false;
 		bool rotate = false;
 		Delay drag;
diff --git a/src/MainWindow.cs b/src/MainWindow.cs
index 5723385..1e92a8d 100644
--- a/src/MainWindow.cs
+++ b/src/MainWindow.cs
@@ -865,12 +865,6 @@ public class MainWindow {
 		return SelectedPhotos (SelectedIds ());
 	}
 
-	[Obsolete ("MARKED FOR REMOVAL")]
-	public Photo [] ActivePhotos () 
-	{
-		return query.Photos;
-	}
-
 	public PhotoQuery Query {
 		get { return query; }
 	}
@@ -903,12 +897,7 @@ public class MainWindow {
 	//
 	// Tag Selection Drag Handlers
 	//
-	[Obsolete ("Use AddTagExtended (int [], Tag []) instead")]
-	public void AddTagExtended (int num, Tag [] tags)
-	{
-		AddTagExtended (new int [] {num}, tags);
-	}
-
+	
 	public void AddTagExtended (int [] nums, Tag [] tags)
 	{
 		foreach (int num in nums)
@@ -2937,7 +2926,7 @@ public class MainWindow {
 		try {
 			application.LaunchUris (uri_list, null);
 		} catch (System.Exception) {
-			Log.ErrorFormat ("Failed to lauch {0}", application.Name);
+			Log.Error ("Failed to lauch {0}", application.Name);
 		}
 	}
 
diff --git a/src/PhotoLoader.cs b/src/PhotoLoader.cs
index 89a6a43..ea10ce6 100644
--- a/src/PhotoLoader.cs
+++ b/src/PhotoLoader.cs
@@ -41,13 +41,6 @@ namespace FSpot {
 			return ValidateThumbnail (item.DefaultVersionUri, pixbuf);
 		}
 
-		[Obsolete ("Use ValidateThumbnail (uri, Pixbuf) instead")]
-		static public Gdk.Pixbuf ValidateThumbnail (string photo_path, Gdk.Pixbuf pixbuf)
-		{			
-			System.Uri uri = UriUtils.PathToFileUri (photo_path);
-			return ValidateThumbnail (uri, pixbuf);
-		}
-		
 		static public Gdk.Pixbuf ValidateThumbnail (System.Uri uri, Gdk.Pixbuf pixbuf)
 		{			
 			using (Gdk.Pixbuf thumbnail = ThumbnailCache.Default.GetThumbnailForUri (uri)) {
diff --git a/src/PhotoStore.cs b/src/PhotoStore.cs
index cd0ba39..25b7da6 100644
--- a/src/PhotoStore.cs
+++ b/src/PhotoStore.cs
@@ -167,18 +167,6 @@ public class PhotoStore : DbStore<Photo> {
 		return null;
 	}
 
-	[Obsolete ("Use Create (Uri, uint, out Pixbuf) instead")]
-	public Photo Create (string path, uint roll_id, out Pixbuf thumbnail)
-	{
-		return Create (path, path, roll_id, out thumbnail);
-	}
-
-	[Obsolete ("Use Create (Uri, Uri, uint, out Pixbuf) instead")]
-	public Photo Create (string new_path, string orig_path, uint roll_id, out Pixbuf thumbnail)
-	{
-		return Create (UriUtils.PathToFileUri (new_path), UriUtils.PathToFileUri (orig_path), roll_id, out thumbnail);
-	}
-
 	public Photo Create (System.Uri uri, uint roll_id, out Pixbuf thumbnail)
 	{
 		return Create (uri, uri, roll_id, out thumbnail);
@@ -349,12 +337,6 @@ public class PhotoStore : DbStore<Photo> {
 		return photo;
 	}
 
-	[Obsolete ("Use GetByUri instead")]
-	public Photo GetByPath (string path)
-	{
-		return GetByUri (UriUtils.PathToFileUri (path));
-	}
-
 	public Photo GetByUri (System.Uri uri)
 	{
 		Photo photo = null;
@@ -625,7 +607,7 @@ public class PhotoStore : DbStore<Photo> {
 	public event EventHandler<DbItemEventArgs<Photo>> ItemsRemovedOverDBus;
 
 	public Photo CreateOverDBus (string new_path, string orig_path, uint roll_id, out Gdk.Pixbuf pixbuf)  {
-		Photo photo = Create (new_path, orig_path, roll_id, out pixbuf);
+		Photo photo = Create (UriUtils.PathToFileUri (new_path), UriUtils.PathToFileUri (orig_path), roll_id, out pixbuf);
 		EmitAddedOverDBus (photo);
 
 		return photo;
@@ -906,23 +888,6 @@ public class PhotoStore : DbStore<Photo> {
 		return query_result.ToArray ();
 	}
 
-//	[Obsolete ("No longer make any sense with uris...")]
-//	public Photo [] Query (System.IO.DirectoryInfo dir)
-//	{
-//		return Query (new DbCommand (
-//			"SELECT photos.id, "			+
-//				"photos.time, "			+
-//				"photos.uri, "			+
-//				"photos.description, "		+
-//				"photos.roll_id, "		+
-//				"photos.default_version_id, "	+
-//				"photos.rating "		+
-//			"FROM photos " 				+
-//			"WHERE uri LIKE \"file://:dir%\" "	+
-//			"AND uri NOT LIKE \"file://:dir/%/%\"",
-//			"dir", dir.FullName ));
-//	}
-
 	public Photo [] Query (System.Uri uri)
 	{
 		Log.Debug ("Query Uri {0}", uri);
diff --git a/src/Preferences.cs b/src/Preferences.cs
index 29c5803..50955f2 100644
--- a/src/Preferences.cs
+++ b/src/Preferences.cs
@@ -171,25 +171,6 @@ namespace FSpot
 			}
 		}
 		
-		[Obsolete ("use Get<T> (string key) instead")]
-		public static object Get (string key)
-		{
-			lock (cache) {
-				object val = null;
-				if (cache.TryGetValue (key, out val)) 
-					return val;
-
-				try {
-					val = Backend.Get (key);
-				} catch (NoSuchKeyException) {
-					val = GetDefault (key);
-				}
-				
-				cache.Add (key, val);
-				return val;
-			}
-		}
-
 		//return true if the key exists in the backend
 		public static bool TryGet<T> (string key, out T value)
 		{
diff --git a/src/RotateCommand.cs b/src/RotateCommand.cs
index 8f6f7c5..6a254df 100644
--- a/src/RotateCommand.cs
+++ b/src/RotateCommand.cs
@@ -133,7 +133,7 @@ namespace FSpot {
 
 			Rotate (original_path, direction);
 
-			Gdk.Pixbuf thumb = FSpot.ThumbnailGenerator.Create (original_path);
+			Gdk.Pixbuf thumb = FSpot.ThumbnailGenerator.Create (UriUtils.PathToFileUri (original_path));
 			if (thumb != null)
 				thumb.Dispose ();
 		
diff --git a/src/ThumbnailGenerator.cs b/src/ThumbnailGenerator.cs
index 19bcd96..fdcfafd 100644
--- a/src/ThumbnailGenerator.cs
+++ b/src/ThumbnailGenerator.cs
@@ -22,12 +22,6 @@ namespace FSpot {
 		public const string ThumbImageWidth = "tEXt::Thumb::Image::Width";
 		public const string ThumbImageHeight = "tEXt::Thumb::Image::Height"; 
 
-		[Obsolete ("Use Create (Uri) instead")]
-		public static Gdk.Pixbuf Create (string path)
-		{
-			return Create (UriUtils.PathToFileUri (path));
-		}
-		
 		public static Gdk.Pixbuf Create (Uri uri)
 		{
 			try {
diff --git a/src/Utils/Log.cs b/src/Utils/Log.cs
index 6236eba..e31ef9b 100644
--- a/src/Utils/Log.cs
+++ b/src/Utils/Log.cs
@@ -273,12 +273,6 @@ namespace FSpot.Utils
         #endregion
 
         #region Public Trace Methods
-	[Obsolete ("use Trace ()")]
-        public static void TraceFormat (string group, string format, params object [] args)
-	{
-		Trace (group, format, args);
-	}
-
         public static void Trace (string group, string format, params object [] args)
         {
             if (Tracing) {
@@ -294,32 +288,26 @@ namespace FSpot.Utils
                 Commit (LogEntryType.Debug, message, null, false);
             }
         }
-        
-	[Obsolete ("use Debug ()")]
-        public static void DebugFormat (string format, params object [] args)
-	{
-		Debug (format, args);
-	}
-
-        public static void Debug (string format, params object [] args)
+ 
+		public static void Debug (string format, params object [] args)
         {
             if (Debugging) {
                 Debug (String.Format (format, args));
             }
         }
 	
-	public static void DebugException (Exception e)
-	{
-	    if (Debugging)
-	        Exception (e);
-	}
-
-	public static void DebugException (string message, Exception e)
-	{
-	    if (Debugging)
-		Exception (message, e);
-
-	}
+		public static void DebugException (Exception e)
+		{
+		    if (Debugging)
+		        Exception (e);
+		}
+	
+		public static void DebugException (string message, Exception e)
+		{
+		    if (Debugging)
+			Exception (message, e);
+	
+		}
         #endregion
         
         #region Public Information Methods
@@ -333,12 +321,6 @@ namespace FSpot.Utils
             Information (message, null, showUser);
         }
         
-	[Obsolete ("use Information ()")]
-        public static void InformationFormat (string format, params object [] args)
-	{
-		Information (format, args);
-	}
-
         public static void Information (string format, params object [] args)
         {
             Information (String.Format (format, args), null, false);
@@ -355,14 +337,8 @@ namespace FSpot.Utils
         {
             Warning (message, null, showUser);
         }
-        
-	[Obsolete ("use Warning ()")]
-        public static void WarningFormat (string format, params object [] args)
-	{
-		Warning (format, args);	
-	}
 
-        public static void Warning (string format, params object [] args)
+		public static void Warning (string format, params object [] args)
         {
             Warning (String.Format (format, args), false);
         }
@@ -379,12 +355,6 @@ namespace FSpot.Utils
             Error (message, null, showUser);
         }
 
-	[Obsolete ("use Error ()")]
-        public static void ErrorFormat (string format, params object [] args)
-	{
-		Error (format, args);
-	}
-
         public static void Error (string format, params object [] args)
         {
             Error (String.Format (format, args), null, false);
@@ -420,17 +390,12 @@ namespace FSpot.Utils
             // FIXME: We should save these to an actual log file
             Log.Warning (message ?? "Caught an exception", builder.ToString (), false);
         }
-        
-	[Obsolete ("use Exception ()")]
-	public static void ExceptionFormat (Exception e, string format, params object [] args)
-	{
-		Exception (e, format, args);
-	}
-
-	public static void Exception (Exception e, string format, params object [] args)
-	{
-		Exception (String.Format (format, args), e);
-	}
-        #endregion
+		
+		public static void Exception (Exception e, string format, params object [] args)
+		{
+			Exception (String.Format (format, args), e);
+		}
+		
+	#endregion
     }
 }



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