[f-spot] remove wrong usage of IsFile for Uris



commit 11bec21f1e79cfdbd54c203d1739fb2e7405d2f7
Author: Mike Gemünde <mike gemuende de>
Date:   Wed Jul 15 22:57:30 2009 +0200

    remove wrong usage of IsFile for Uris

 src/PhotoStore.cs          |    6 ++++--
 src/Utils/UriExtensions.cs |    3 ---
 2 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/src/PhotoStore.cs b/src/PhotoStore.cs
index 0ac5bab..c788e4d 100644
--- a/src/PhotoStore.cs
+++ b/src/PhotoStore.cs
@@ -900,8 +900,10 @@ public class PhotoStore : DbStore<Photo> {
 
 	public Photo [] Query (System.Uri uri)
 	{
+		string filename = uri.GetFilename ();
+		
 		/* query by file */
-		if (uri.IsFile) {
+		if ( ! String.IsNullOrEmpty (filename)) {
 			return Query (new DbCommand (
 			"SELECT id, "			+
 				"time, "			+
@@ -916,7 +918,7 @@ public class PhotoStore : DbStore<Photo> {
 			"WHERE base_uri LIKE :base_uri "		+
 			"AND filename LIKE :filename",
 			"base_uri", uri.GetDirectoryUri ().ToString (),
-			"filename", uri.GetFilename ()));
+			"filename", filename));
 		}
 		
 		/* query by directory */
diff --git a/src/Utils/UriExtensions.cs b/src/Utils/UriExtensions.cs
index 9991e63..30f43a6 100644
--- a/src/Utils/UriExtensions.cs
+++ b/src/Utils/UriExtensions.cs
@@ -25,9 +25,6 @@ namespace FSpot.Utils
 		
 		public static string GetFilename (this Uri uri)
 		{
-			if ( ! uri.IsFile)
-				return null;
-			
 			return System.IO.Path.GetFileName (uri.AbsolutePath);
 		}
 	}



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