f-spot r3666 - in trunk/extensions: FlickrExport PicasaWebExport



Author: sdelcroix
Date: Mon Feb 11 15:46:22 2008
New Revision: 3666
URL: http://svn.gnome.org/viewvc/f-spot?rev=3666&view=rev

Log:
fix exporters for --view mode

Modified:
   trunk/extensions/FlickrExport/FlickrExport.addin.xml
   trunk/extensions/FlickrExport/FlickrExport.cs
   trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml
   trunk/extensions/PicasaWebExport/PicasaWebExport.cs

Modified: trunk/extensions/FlickrExport/FlickrExport.addin.xml
==============================================================================
--- trunk/extensions/FlickrExport/FlickrExport.addin.xml	(original)
+++ trunk/extensions/FlickrExport/FlickrExport.addin.xml	Mon Feb 11 15:46:22 2008
@@ -1,5 +1,5 @@
 <Addin namespace="FSpot"
-	version="1.1"
+	version="1.2"
 	name="Flickr Export"
 	description="This extension allows you to export your photos to Flickr and 23hq."
 	author="F-Spot team"

Modified: trunk/extensions/FlickrExport/FlickrExport.cs
==============================================================================
--- trunk/extensions/FlickrExport/FlickrExport.cs	(original)
+++ trunk/extensions/FlickrExport/FlickrExport.cs	Mon Feb 11 15:46:22 2008
@@ -1,5 +1,6 @@
 using FlickrNet;
 using System;
+using System.Collections;
 using System.IO;
 using System.Threading;
 using Mono.Unix;
@@ -287,15 +288,23 @@
 			}
 			progress_dialog.Fraction = (photo_index - 1.0 + (args.Bytes / (double) info.Length)) / (double) selection.Count;		      
 		}
-		
+
+		private class DateComparer : IComparer
+		{
+			public int Compare (object left, object right)
+			{
+				return DateTime.Compare ((left as IBrowsableItem).Time, (right as IBrowsableItem).Time);
+			}
+		}
+	
 		private void Upload () {
 			progress_item = new ProgressItem ();
 			progress_item.Changed += HandleProgressChanged;
 			fr.Connection.OnUploadProgress += HandleFlickrProgress;
 
 			System.Collections.ArrayList ids = new System.Collections.ArrayList ();
-			FSpot.Photo [] photos = (FSpot.Photo []) selection.Items;
-			Array.Sort (photos, new FSpot.Photo.CompareDateName ());
+			IBrowsableItem [] photos = selection.Items;
+			Array.Sort (photos, new DateComparer ());
 
 			for (int index = 0; index < photos.Length; index++) {
 				try {

Modified: trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml
==============================================================================
--- trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml	(original)
+++ trunk/extensions/PicasaWebExport/PicasaWebExport.addin.xml	Mon Feb 11 15:46:22 2008
@@ -1,5 +1,5 @@
 <Addin namespace="FSpot"
-	version="1.1"
+	version="1.2"
 	name="PicasaWeb Export"
 	description="This extension allows you to export your photos to PicasaWeb."
 	author="F-Spot team"

Modified: trunk/extensions/PicasaWebExport/PicasaWebExport.cs
==============================================================================
--- trunk/extensions/PicasaWebExport/PicasaWebExport.cs	(original)
+++ trunk/extensions/PicasaWebExport/PicasaWebExport.cs	Mon Feb 11 15:46:22 2008
@@ -622,6 +622,14 @@
 				progress_dialog.Fraction = ((photo_index - 1) / (double) items.Length) + (args.BytesSent / (args.BytesTotal * (double) items.Length));
 		}
 
+		private class DateComparer : IComparer
+		{
+			public int Compare (object left, object right)
+			{
+				return DateTime.Compare ((left as IBrowsableItem).Time, (right as IBrowsableItem).Time);
+			}
+		}
+
 		private void Upload ()
 		{
 			album.UploadProgress += HandleUploadProgress;
@@ -639,7 +647,7 @@
 			if (rotate)
 				filters.Add (new OrientationFilter ());
 
-			Array.Sort (items as Photo[], new Photo.CompareDateName ());
+			Array.Sort (items, new DateComparer ());
 
 			while (photo_index < items.Length) {
 				try {



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