commit 975d52106bf1a940e2b01490b79130fced165aae
Author: Nuno Ferreira <email.do.nuno@gmail.com>
Date:   Fri Aug 13 09:35:49 2010 +0100

    Do not crash when rotating an image with a non-file URI

diff --git a/src/Clients/MainApp/FSpot/RotateCommand.cs b/src/Clients/MainApp/FSpot/RotateCommand.cs
index 603ab51..c948620 100644
--- a/src/Clients/MainApp/FSpot/RotateCommand.cs
+++ b/src/Clients/MainApp/FSpot/RotateCommand.cs
@@ -84,21 +84,18 @@ namespace FSpot {
 		{
 			RotateOrientation (original_path, dir);
 		}
-
-		public bool Step () {
-			string original_path;
-
+		
+		public bool Step ()
+		{
 			if (done)
 				return false;
 
-			original_path = item.DefaultVersion.Uri.LocalPath;
-			done = true;
-
-			if ((File.GetAttributes(original_path) & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) {
-				throw new RotateException (Catalog.GetString ("Unable to rotate readonly file"), original_path, true);
+			GLib.FileInfo info = GLib.FileFactory.NewForUri (item.DefaultVersion.Uri).QueryInfo ("access::can-write", GLib.FileQueryInfoFlags.None, null);
+			if (!info.GetAttributeBoolean("access::can-write")) {
+				throw new RotateException (Catalog.GetString ("Unable to rotate readonly file"), item.DefaultVersion.Uri, true);
 			}
 
-			Rotate (original_path, direction);
+			Rotate (item.DefaultVersion.Uri, direction);
 
 			return !done;
 		}
