[f-spot] drop more obsolete stuffs



commit dce1578eb723677aea779d7ad21672fdf331e0a7
Author: Stephane Delcroix <stephane delcroix org>
Date:   Mon Jul 6 14:09:03 2009 +0200

    drop more obsolete stuffs

 extensions/Exporters/FlickrExport/FlickrExport.cs  |    4 +-
 .../Exporters/PicasaWebExport/PicasaWebExport.cs   |    4 +-
 src/PhotoStore.cs                                  |   79 --------------------
 src/Util.cs                                        |   29 -------
 4 files changed, 4 insertions(+), 112 deletions(-)
---
diff --git a/extensions/Exporters/FlickrExport/FlickrExport.cs b/extensions/Exporters/FlickrExport/FlickrExport.cs
index 2335c55..a677505 100644
--- a/extensions/Exporters/FlickrExport/FlickrExport.cs
+++ b/extensions/Exporters/FlickrExport/FlickrExport.cs
@@ -131,8 +131,8 @@ namespace FSpotFlickrExport {
 					if (used_bandwidth.Visible) {
 						used_bandwidth.Fraction = fr.Connection.PeopleGetUploadStatus().PercentageUsed;
 						used_bandwidth.Text = string.Format (Catalog.GetString("Used {0} of your allowed {1} monthly quota"),
-									SizeUtil.ToHumanReadable(fr.Connection.PeopleGetUploadStatus().BandwidthUsed),
-									SizeUtil.ToHumanReadable(fr.Connection.PeopleGetUploadStatus().BandwidthMax));
+									GLib.Format.SizeForDisplay (fr.Connection.PeopleGetUploadStatus().BandwidthUsed),
+									GLib.Format.SizeForDisplay (fr.Connection.PeopleGetUploadStatus().BandwidthMax));
 					}
 					break;
 				}
diff --git a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
index 6e2d3fc..000144b 100644
--- a/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
+++ b/extensions/Exporters/PicasaWebExport/PicasaWebExport.cs
@@ -617,9 +617,9 @@ namespace FSpotGoogleExport {
 		private void HandleUploadProgress(object o, UploadProgressEventArgs args)
 		{
 				if (approx_size == 0)
-					progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} Sent"), SizeUtil.ToHumanReadable(args.BytesSent));
+					progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} Sent"), GLib.Format.SizeForDisplay (args.BytesSent));
 				else
-					progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} of approx. {1}"), SizeUtil.ToHumanReadable(sent_bytes + args.BytesSent), SizeUtil.ToHumanReadable(approx_size));
+					progress_dialog.ProgressText = System.String.Format (Catalog.GetString ("{0} of approx. {1}"), GLib.Format.SizeForDisplay (sent_bytes + args.BytesSent), GLib.Format.SizeForDisplay (approx_size));
 				progress_dialog.Fraction = ((photo_index - 1) / (double) items.Length) + (args.BytesSent / (args.BytesTotal * (double) items.Length));
 		}
 
diff --git a/src/PhotoStore.cs b/src/PhotoStore.cs
index 03a66ae..664c640 100644
--- a/src/PhotoStore.cs
+++ b/src/PhotoStore.cs
@@ -944,91 +944,12 @@ public class PhotoStore : DbStore<Photo> {
 	}
 
 	[Obsolete ("drop this, use IQueryCondition correctly instead")]
-	public void QueryToTemp (string temp_table, Tag [] tags, string extra_condition, DateRange range, RollSet importidrange, RatingRange ratingrange, OrderByTime orderbytime)
-	{
-		QueryToTemp (temp_table, FSpot.OrTerm.FromTags(tags), extra_condition, range, importidrange, ratingrange, orderbytime);
-	}
-
-	[Obsolete ("drop this, use IQueryCondition correctly instead")]
 	public Photo [] Query (Tag [] tags, string extra_condition, DateRange range, RollSet importidrange, RatingRange ratingrange)
 	{
 		return Query (FSpot.OrTerm.FromTags(tags), extra_condition, range, importidrange, ratingrange);
 	}
 
 	[Obsolete ("drop this, use IQueryCondition correctly instead")]
-	public void QueryToTemp (string temp_table, Term searchexpression, string extra_condition, DateRange range, RollSet importidrange, RatingRange ratingrange, OrderByTime orderbytime)
-	{
-		bool hide = (extra_condition == null);
-
-		// The SQL query that we want to construct is:
-		//
-		// SELECT photos.id
-		//        photos.time
-		//        photos.uri,
-		//        photos.description,
-		//	  photos.roll_id,
-		//        photos.default_version_id
-		//        photos.rating
-		//                  FROM photos, photo_tags
-		//		    WHERE photos.time >= time1 AND photos.time <= time2
-		//				AND photos.rating >= rat1 AND photos.rating <= rat2
-		//				AND photos.id NOT IN (select photo_id FROM photo_tags WHERE tag_id = HIDDEN)
-		//				AND photos.id IN (select photo_id FROM photo_tags where tag_id IN (tag1, tag2..)
-		//				AND extra_condition_string
-		//                  GROUP BY photos.id
-
-		StringBuilder query_builder = new StringBuilder ();
-		ArrayList where_clauses = new ArrayList ();
-		query_builder.Append ("SELECT id, " 			+
-					     "time, "			+
-					     "base_uri, "			+
-					     "filename, "			+
-					     "description, "		+
-					     "roll_id, "   		+
-					     "default_version_id, "	+
-					     "rating, "			+
-					     "md5_sum "			+
-				      "FROM photos ");
-
-		if (range != null) {
-			where_clauses.Add (String.Format ("time >= {0} AND time <= {1}",
-							  DbUtils.UnixTimeFromDateTime (range.Start),
-							  DbUtils.UnixTimeFromDateTime (range.End)));
-
-		}
-
-		if (ratingrange != null) {
-			where_clauses.Add (ratingrange.SqlClause ());
-		}
-
-		if (importidrange != null) {
-			where_clauses.Add (importidrange.SqlClause ());
-		}
-
-		if (hide && Core.Database.Tags.Hidden != null) {
-			where_clauses.Add (String.Format ("id NOT IN (SELECT photo_id FROM photo_tags WHERE tag_id = {0})",
-							  FSpot.Core.Database.Tags.Hidden.Id));
-		}
-
-		if (searchexpression != null) {
-			where_clauses.Add (searchexpression.SqlCondition ());
-		}
-
-		if (extra_condition != null && extra_condition.Trim () != String.Empty) {
-			where_clauses.Add (extra_condition);
-		}
-
-		if (where_clauses.Count > 0) {
-			query_builder.Append (" WHERE ");
-			query_builder.Append (String.Join (" AND ", ((String []) where_clauses.ToArray (typeof(String)))));
-		}
-		query_builder.Append (" ORDER BY ");
-		query_builder.Append (orderbytime.SqlClause ());
-
-		QueryToTemp (temp_table, query_builder.ToString ());
-	}
-
-	[Obsolete ("drop this, use IQueryCondition correctly instead")]
 	public Photo [] Query (Term searchexpression, string extra_condition, DateRange range, RollSet importidrange, RatingRange ratingrange)
 	{
 		bool hide = (extra_condition == null);
diff --git a/src/Util.cs b/src/Util.cs
index 19a5544..31af04d 100644
--- a/src/Util.cs
+++ b/src/Util.cs
@@ -147,35 +147,6 @@ namespace FSpot.Utils
 			return paths;
 		}
 	}
-	
-	
-	public class SizeUtil {
-		[Obsolete ("Use GLib.Format.SizeForDisplay (gtk-sharp > 2.14)")]
-		public static string ToHumanReadable (long size)
-		{
-			string tmp_str = String.Empty;
-			float tmp_size = size;
-			int k = 0;
-			string[] size_abr = {"bytes", "kB", "MB", "GB", "TB" };
-			
-			while (tmp_size > 700) { //it's easier to read 0.9MB than 932kB
-				tmp_size = tmp_size / 1024;
-					k++;
-			}
-			
-			if (tmp_size < 7)
-				tmp_str = tmp_size.ToString ("0.##");
-			else if (tmp_size < 70)
-				tmp_str = tmp_size.ToString ("##.#");
-			else
-				tmp_str = tmp_size.ToString ("#,###");
-			
-			if (k < size_abr.Length)
-				return tmp_str + " " + size_abr[k];
-			else
-					return size.ToString();
-		}
-	}
 }
 
 



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