[f-spot] Replace CheapEscape by GLib.Shell.Escape.



commit 0c37de743fefb66570f638ed1698ceb1f512b083
Author: Ruben Vermeersch <ruben savanne be>
Date:   Wed Jul 29 16:44:12 2009 +0200

    Replace CheapEscape by GLib.Shell.Escape.
    
    Fixes Bug 576411 â?? DevelopInUfraw doesn't work properly in Dutch locale because
    the Dutch translation for "Photos" contains a ' character
    
    MetaPixel is broken though, but it already was before this.

 extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs |   13 ++-----------
 extensions/Tools/DevelopInUFraw/Makefile.am       |    1 +
 extensions/Tools/MetaPixel/Makefile               |    1 +
 extensions/Tools/MetaPixel/MetaPixel.cs           |   17 ++++-------------
 4 files changed, 8 insertions(+), 24 deletions(-)
---
diff --git a/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs b/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
index 1a361b4..7dffc6e 100644
--- a/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
+++ b/extensions/Tools/DevelopInUFraw/DevelopInUFRaw.cs
@@ -127,8 +127,8 @@ namespace DevelopInUFRawExtension
 			args += String.Format(" --overwrite --create-id=also --compression={0} --out-type=jpeg {1} --output={2} {3}",
 				ufraw_jpeg_quality,
 				idfile,
-				CheapEscape (developed.LocalPath),
-				CheapEscape (raw.Uri.ToString ()));
+				GLib.Shell.Quote (developed.LocalPath),
+				GLib.Shell.Quote (raw.Uri.LocalPath));
 			Log.Debug (executable + " " + args);
 
 			System.Diagnostics.Process ufraw = System.Diagnostics.Process.Start (executable, args);
@@ -165,15 +165,6 @@ namespace DevelopInUFRawExtension
 					       + " (" + version_name + ")" + ".jpg"));
 		}
 
-		private static string CheapEscape (string input)
-		{
-			string escaped = input;
-			escaped = escaped.Replace (" ", "\\ ");
-			escaped = escaped.Replace ("(", "\\(");
-			escaped = escaped.Replace (")", "\\)");
-			return escaped;
-		}
-
 		private static string DirectoryPath (Photo p)
 		{
 			System.Uri uri = p.VersionUri (Photo.OriginalVersionId);
diff --git a/extensions/Tools/DevelopInUFraw/Makefile.am b/extensions/Tools/DevelopInUFraw/Makefile.am
index 1868c82..b1e4fdc 100644
--- a/extensions/Tools/DevelopInUFraw/Makefile.am
+++ b/extensions/Tools/DevelopInUFraw/Makefile.am
@@ -17,6 +17,7 @@ REFS =					\
 	-r:$(top_builddir)/src/FSpot.Query.dll	\
 	$(LINK_SEMWEB)				\
 	$(LINK_MONO_ADDINS)			\
+	$(LINK_GTKSHARPBEANS)			\
 	$(LINK_GPHOTO2)
 
 PKGS =					\
diff --git a/extensions/Tools/MetaPixel/Makefile b/extensions/Tools/MetaPixel/Makefile
index 0cff7f0..8cc0e7e 100644
--- a/extensions/Tools/MetaPixel/Makefile
+++ b/extensions/Tools/MetaPixel/Makefile
@@ -6,6 +6,7 @@ PACKAGES = \
 	-pkg:glade-sharp-2.0
 
 ASSEMBLIES = \
+	-r:../../../lib/gtk-sharp-beans/gtk-sharp-beans.dll \
 	-r:../../../lib/gio-sharp/gio/gio-sharp.dll \
 	-r:Mono.Posix
 
diff --git a/extensions/Tools/MetaPixel/MetaPixel.cs b/extensions/Tools/MetaPixel/MetaPixel.cs
index 81f12e2..08e8bec 100644
--- a/extensions/Tools/MetaPixel/MetaPixel.cs
+++ b/extensions/Tools/MetaPixel/MetaPixel.cs
@@ -160,8 +160,8 @@ namespace MetaPixelExtension {
 				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
-									CheapEscape(freq.Current.LocalPath), //Source image
-									CheapEscape(minifile),  //Dest image
+									GLib.Shell.Quote (freq.Current.LocalPath), //Source image
+									GLib.Shell.Quote (minifile),  //Dest image
 									minidir_tmp);  //Table file
 				Log.Debug ("Executing: metapixel " + prepare_command);
 
@@ -209,8 +209,8 @@ namespace MetaPixelExtension {
 
 				string mosaic_command = String.Format ("--metapixel -l {0} {1} {2}",
 									minidir_tmp,
-									CheapEscape (freq.Current.LocalPath),
-									CheapEscape (mosaic.LocalPath));
+									GLib.Shell.Quote (freq.Current.LocalPath),
+									GLib.Shell.Quote (mosaic.LocalPath));
 				Log.Debug ("Executing: metapixel " + mosaic_command);
 				System.Diagnostics.Process mp_exe = System.Diagnostics.Process.Start ("metapixel", mosaic_command);
 				mp_exe.WaitForExit ();
@@ -265,15 +265,6 @@ namespace MetaPixelExtension {
                                                + " (" + version_name + ")" + ".jpg"));
                 }
 
-                private static string CheapEscape (string input)
-                {
-                        string escaped = input;
-                        escaped = escaped.Replace (" ", "\\ ");
-                        escaped = escaped.Replace ("(", "\\(");
-                        escaped = escaped.Replace (")", "\\)");
-                        return escaped;
-                }
-
                 private static string DirectoryPath (Photo p)
                 {
                         System.Uri uri = p.VersionUri (Photo.OriginalVersionId);



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