[f-spot] Removing a pile of obsolete code.



commit a0810041026ed7c64e875182ea420356c7a15cd1
Author: Ruben Vermeersch <ruben savanne be>
Date:   Wed May 26 09:32:32 2010 +0200

    Removing a pile of obsolete code.

 extensions/Exporters/FolderExport/FolderExport.cs |    2 +-
 src/Imaging/DCRawFile.cs                          |    4 -
 src/Imaging/ImageFile.cs                          |    6 -
 src/Imaging/JpegFile.cs                           |    4 -
 src/Imaging/JpegHeader.cs                         |    3 +-
 src/Imaging/MrwFile.cs                            |    4 -
 src/Imaging/PngFile.cs                            |    4 -
 src/Imaging/PnmFile.cs                            |   38 ------
 src/Imaging/RafFile.cs                            |    4 -
 src/Imaging/SvgFile.cs                            |    4 -
 src/Imaging/Tiff.cs                               |   35 -----
 src/Imaging/X3fFile.cs                            |    4 -
 src/Utils/UriUtils.cs                             |   31 -----
 tests/src/Filters/JpegFilter.cs                   |   73 ----------
 tests/src/Filters/OrientationFilter.cs            |   15 --
 tests/src/IBrowsableItem.cs                       |   79 -----------
 tests/src/Makefile.am                             |    7 +-
 tests/src/PhotoStore.cs                           |  147 ---------------------
 tests/src/ThumbnailGenerator.cs                   |  130 ------------------
 19 files changed, 4 insertions(+), 590 deletions(-)
---
diff --git a/extensions/Exporters/FolderExport/FolderExport.cs b/extensions/Exporters/FolderExport/FolderExport.cs
index 97ec4b6..08d8440 100644
--- a/extensions/Exporters/FolderExport/FolderExport.cs
+++ b/extensions/Exporters/FolderExport/FolderExport.cs
@@ -472,7 +472,7 @@ namespace FSpotFolderExport {
 								      ExportStore.FolderExportType,
 								      // FIXME this is wrong, the final path is the one
 								      // after the Xfer.
-								      UriUtils.PathToFileUriEscaped (path).ToString ());
+								      new SafeUri (path).ToString ());
 				}
 
 				using (Exif.ExifData data = new Exif.ExifData (photo_path)) {
diff --git a/src/Imaging/DCRawFile.cs b/src/Imaging/DCRawFile.cs
index f65eab9..096d701 100644
--- a/src/Imaging/DCRawFile.cs
+++ b/src/Imaging/DCRawFile.cs
@@ -75,10 +75,6 @@ namespace FSpot {
 	public class DCRawFile : ImageFile {
 		const string dcraw_command = "dcraw";
 
-		public DCRawFile (string path) : base (path)
-		{
-		}
-
 		public DCRawFile (SafeUri uri) : base (uri)
 		{
 		}
diff --git a/src/Imaging/ImageFile.cs b/src/Imaging/ImageFile.cs
index 77a9fe6..f30d5e3 100644
--- a/src/Imaging/ImageFile.cs
+++ b/src/Imaging/ImageFile.cs
@@ -23,12 +23,6 @@ namespace FSpot {
 
 		static Hashtable name_table;
 		internal static Hashtable NameTable { get { return name_table; } }
-
-		[Obsolete("Use ImageFile (SafeUri) instead!")]
-		public ImageFile (string path) 
-		{
-			this.uri = new SafeUri (path);
-		}
 		
 		public ImageFile (SafeUri uri)
 		{
diff --git a/src/Imaging/JpegFile.cs b/src/Imaging/JpegFile.cs
index 58fff9e..7ecac8c 100644
--- a/src/Imaging/JpegFile.cs
+++ b/src/Imaging/JpegFile.cs
@@ -31,10 +31,6 @@ namespace FSpot {
 			}
 		}
 		
-		public JpegFile (string path) : base (path) 
-		{
-		}
-
 		public JpegHeader Header {
 			get {
 				if (header == null) {
diff --git a/src/Imaging/JpegHeader.cs b/src/Imaging/JpegHeader.cs
index 1fd2e5a..93624b7 100644
--- a/src/Imaging/JpegHeader.cs
+++ b/src/Imaging/JpegHeader.cs
@@ -23,6 +23,7 @@ using System.Collections;
 using FSpot.Xmp;
 using FSpot;
 using FSpot.Utils;
+using Hyena;
 
 #if ENABLE_NUNIT
 using NUnit.Framework;
@@ -664,7 +665,7 @@ public class JpegHeader : SemWeb.StatementSource {
 			PixbufOrientation orient = PixbufOrientation.TopRight;
 
 			PixbufUtils.SaveJpeg (test, path, quality, new Exif.ExifData ());
-			FSpot.JpegFile jimg = new FSpot.JpegFile (path);
+			FSpot.JpegFile jimg = new FSpot.JpegFile (new SafeUri (path));
 			jimg.SetDescription (desc);
 			jimg.SetOrientation (orient);
 			jimg.SaveMetaData (path);
diff --git a/src/Imaging/MrwFile.cs b/src/Imaging/MrwFile.cs
index c0a9fed..309784d 100644
--- a/src/Imaging/MrwFile.cs
+++ b/src/Imaging/MrwFile.cs
@@ -183,10 +183,6 @@ namespace FSpot.Mrw {
                         get { return false; }
                 }
 
-		public MrwFile (string path) : base (path)
-		{
-		}
-
 		public FSpot.Tiff.Header Header {
 			get {
 				if (mrm == null)
diff --git a/src/Imaging/PngFile.cs b/src/Imaging/PngFile.cs
index 07b5b51..dd868ea 100644
--- a/src/Imaging/PngFile.cs
+++ b/src/Imaging/PngFile.cs
@@ -36,10 +36,6 @@ namespace FSpot.Png {
 		{
 		}
 
-		public PngFile (string path) : base (path)
-		{
-		}
-
 
 		/**
 		   Title 	Short (one line) title or caption for image 
diff --git a/src/Imaging/PnmFile.cs b/src/Imaging/PnmFile.cs
index ab44ea9..f7896b4 100644
--- a/src/Imaging/PnmFile.cs
+++ b/src/Imaging/PnmFile.cs
@@ -20,10 +20,6 @@ namespace FSpot.Pnm {
 		{
 		}
 
-		public PnmFile (string path) : base (path) 
-		{
-		}
-
 		public class Header {
 			public string Magic;
 			public int Width;
@@ -282,38 +278,4 @@ namespace FSpot.Pnm {
 			}			
 		}
 	}
-
-#if ENABLE_NUNIT
-	[TestFixture]
-	public class Tests {
-		[Test]
-		public void SaveLoad ()
-		{
-			using (Gdk.Pixbuf pixbuf = new Gdk.Pixbuf (null, "f-spot-32.png")) {
-				Gdk.Pixbuf source = pixbuf;
-				if (pixbuf.HasAlpha)
-					source = PixbufUtils.Flatten (pixbuf);
-
-				string path = ImageFile.TempPath ("test.ppm");
-				PnmFile pnm = new PnmFile (path);
-				using (Stream stream = File.OpenWrite (path)) {
-					pnm.Save (source, stream);
-				}
-
-				pnm = new PnmFile (path);
-
-				using (Gdk.Pixbuf saved = pnm.Load ()) {
-					Assert.IsNotNull (saved);
-					Assert.AreEqual (saved.Width, source.Width);
-					Assert.AreEqual (saved.Height, source.Height);
-				}
-				
-				if (source != pixbuf)
-					source.Dispose ();
-
-				File.Delete (path);
-			}
-		}
-	}	
-#endif
 }
diff --git a/src/Imaging/RafFile.cs b/src/Imaging/RafFile.cs
index 477abe3..7137855 100644
--- a/src/Imaging/RafFile.cs
+++ b/src/Imaging/RafFile.cs
@@ -58,10 +58,6 @@ namespace FSpot.Raf {
 			return orientation;
 		}
 
-		public RafFile (string path) : base (path)
-		{
-		}
-
 		public override System.IO.Stream PixbufStream ()
 		{
 			byte [] data = GetEmbeddedJpeg ();
diff --git a/src/Imaging/SvgFile.cs b/src/Imaging/SvgFile.cs
index 69b4e3f..2418823 100644
--- a/src/Imaging/SvgFile.cs
+++ b/src/Imaging/SvgFile.cs
@@ -15,10 +15,6 @@ namespace FSpot.Svg {
 		{
 		}
 
-		public SvgFile (string path) : base (path) 
-		{
-		}
-
 		public MetadataStore Store {
 			get {
 				if (store == null) {
diff --git a/src/Imaging/Tiff.cs b/src/Imaging/Tiff.cs
index b21591b..d41cf36 100644
--- a/src/Imaging/Tiff.cs
+++ b/src/Imaging/Tiff.cs
@@ -2023,21 +2023,6 @@ namespace FSpot.Tiff {
                         get { return false; }
                 }
 
-		public TiffFile (string path) : base (path)
-		{
-			try {
-				using (System.IO.Stream input = Open ()) {
-					this.Header = new Header (input);
-				}
-
-#if DEBUG_LOADER
-				Header.Dump (this.ToString () + ":");
-#endif
-			} catch (System.Exception e) {
-				System.Console.WriteLine (e.ToString ());
-			}
-		}
-
 		public TiffFile (SafeUri uri) : base (uri)
 		{
 			try {
@@ -2131,10 +2116,6 @@ namespace FSpot.Tiff {
 	}
 
 	public class DngFile : TiffFile {
-		public DngFile (string path) : base (path) 
-		{
-		}
-
 		public DngFile (SafeUri uri) : base (uri)
 		{
 		}
@@ -2215,10 +2196,6 @@ namespace FSpot.Tiff {
 	}	
 	
 	public class NefFile : TiffFile, IThumbnailContainer {
-		public NefFile (string path) : base (path) 
-		{
-		}
-
 		public NefFile (SafeUri uri) : base (uri)
 		{
 		}
@@ -2279,20 +2256,8 @@ namespace FSpot.Tiff {
 		
 
 	public class Cr2File : TiffFile, IThumbnailContainer {
-		public Cr2File (string path) : base (path) 
-		{
-		}
-
 		public Cr2File (SafeUri uri) : base (uri)
 		{
-//							Gtk.MessageDialog md = new Gtk.MessageDialog (null, 
-//							                                              Gtk.DialogFlags.DestroyWithParent,
-//							                                              Gtk.MessageType.Error, 
-//							                                              Gtk.ButtonsType.Close,
-//							                                              "bca");
-//	
-//							int result = md.Run ();
-//							md.Destroy();
 		}
 
 		/*
diff --git a/src/Imaging/X3fFile.cs b/src/Imaging/X3fFile.cs
index ec93821..233b3a9 100644
--- a/src/Imaging/X3fFile.cs
+++ b/src/Imaging/X3fFile.cs
@@ -90,10 +90,6 @@ namespace FSpot.X3f {
 			}
 		}
 
-		public X3fFile (string path) : base (path)
-		{
-		}
-
 		public X3fFile (SafeUri uri) : base (uri)
 		{
 		}
diff --git a/src/Utils/UriUtils.cs b/src/Utils/UriUtils.cs
index 3c14a52..7dfe86c 100644
--- a/src/Utils/UriUtils.cs
+++ b/src/Utils/UriUtils.cs
@@ -15,37 +15,6 @@ namespace FSpot.Utils
 {
 	public static class UriUtils
 	{		
-		public static string UriToStringEscaped (Uri uri)
-		{
-			return EscapeString (uri.ToString (), false, true, false);
-		}
-	
-		public static string PathToFileUriEscaped (string path)
-		{
-			return UriToStringEscaped (PathToFileUri (path));
-		}
-	
-		public static Uri PathToFileUri (string path)
-		{
-			path = Path.GetFullPath (path);
-	
-			StringBuilder builder = new StringBuilder ();
-			builder.Append (Uri.UriSchemeFile);
-			builder.Append (Uri.SchemeDelimiter);
-	
-			int i;
-			while ((i = path.IndexOfAny (CharsToQuote)) != -1) {
-				if (i > 0)
-					builder.Append (path.Substring (0, i));
-				builder.Append (Uri.HexEscape (path [i]));
-				path = path.Substring (i+1);
-			}
-			builder.Append (path);
-	
-			return new Uri (builder.ToString ());
-		}
-
-		static char[] CharsToQuote = { ';', '?', ':', '@', '&', '=', '$', ',', '#', '%' };
 		// NOTE: this was copied from mono's System.Uri where it is internal.
 		public static string EscapeString (string str, bool escapeReserved, bool escapeHex, bool escapeBrackets) 
 		{
diff --git a/tests/src/Makefile.am b/tests/src/Makefile.am
index c2eddc2..a3da3aa 100644
--- a/tests/src/Makefile.am
+++ b/tests/src/Makefile.am
@@ -1,15 +1,10 @@
 include $(top_srcdir)/Makefile.include
 
 SOURCES = 				\
-	$(srcdir)/IBrowsableItem.cs		\
 	$(srcdir)/ImageTest.cs			\
-	$(srcdir)/PhotoStore.cs			\
 	$(srcdir)/TagStore.cs			\
-	$(srcdir)/ThumbnailGenerator.cs		\
 	$(srcdir)/Query/LogicalTerm.cs		\
-	$(srcdir)/Cms/Cms.cs			\
-	$(srcdir)/Filters/JpegFilter.cs		\
-	$(srcdir)/Filters/OrientationFilter.cs
+	$(srcdir)/Cms/Cms.cs
 
 if ENABLE_TESTS
 



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