f-spot r3935 - in trunk: . src



Author: sdelcroix
Date: Mon May 19 12:20:02 2008
New Revision: 3935
URL: http://svn.gnome.org/viewvc/f-spot?rev=3935&view=rev

Log:
2008-01-12  Roland Mas  <lolando debian org>

	* src/CameraFileSelectionDialog.cs: Sort available files in camera
	import dialog.

	* src/GPhotoCamera.cs: Implemented the IComparable interface for
	the GPhotoCameraFile class.


Modified:
   trunk/ChangeLog
   trunk/src/CameraFileSelectionDialog.cs
   trunk/src/GPhotoCamera.cs

Modified: trunk/src/CameraFileSelectionDialog.cs
==============================================================================
--- trunk/src/CameraFileSelectionDialog.cs	(original)
+++ trunk/src/CameraFileSelectionDialog.cs	Mon May 19 12:20:02 2008
@@ -139,7 +139,9 @@
 				
 				int index = 0;
 				bool load_thumb = true;
-				foreach (GPhotoCameraFile file in camera.FileList) {
+				System.Collections.ArrayList sfiles = camera.FileList;
+				sfiles.Sort ();
+				foreach (GPhotoCameraFile file in sfiles) {
 					string msg = String.Format (Catalog.GetString ("Downloading Preview of {0}"), 
 								    file.FileName);
 					

Modified: trunk/src/GPhotoCamera.cs
==============================================================================
--- trunk/src/GPhotoCamera.cs	(original)
+++ trunk/src/GPhotoCamera.cs	Mon May 19 12:20:02 2008
@@ -251,7 +251,7 @@
 }
 
 	
-public class GPhotoCameraFile
+public class GPhotoCameraFile : IComparable
 {
 	string directory;
 	string filename;
@@ -297,7 +297,7 @@
 		}
 	}
 	
-	public void ReleaseGPhotoResources()
+	public void ReleaseGPhotoResources ()
 	{
 		if (normal != null) 
 			normal.Dispose ();
@@ -305,4 +305,13 @@
 		if (preview != null) 
 			preview.Dispose ();
 	}
+
+	public int CompareTo (object obj)
+	{
+		GPhotoCameraFile f2 = obj as GPhotoCameraFile;
+		int result = Directory.CompareTo (f2.Directory);
+		if (result == 0)
+			result = FileName.CompareTo (f2.FileName);
+		return result;
+	}
 }



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