f-spot r3861 - in trunk: . src src/Core



Author: sdelcroix
Date: Wed Apr 30 14:10:00 2008
New Revision: 3861
URL: http://svn.gnome.org/viewvc/f-spot?rev=3861&view=rev

Log:
2008-04-30  Stephane Delcroix  <sdelcroix novell com>

	* src/Core/Tag.cs:
	* src/TagStore.cs: reverting tag popularity :(


Modified:
   trunk/ChangeLog
   trunk/src/Core/Tag.cs
   trunk/src/TagStore.cs

Modified: trunk/src/Core/Tag.cs
==============================================================================
--- trunk/src/Core/Tag.cs	(original)
+++ trunk/src/Core/Tag.cs	Wed Apr 30 14:10:00 2008
@@ -42,16 +42,14 @@
 	
 		private int sort_priority;
 		public int SortPriority {
-			set { sort_priority = value; }
-			get { return sort_priority; }
+			set {
+				sort_priority = value;
+			}
+			get {
+				return sort_priority;
+			}
 		}
 	
-		private int popularity;
-		public int Popularity {
-			get { return popularity; }
-			set { popularity = value; }
-		}
-
 		// Icon.  If theme_icon_name is not null, then we save the name of the icon instead
 		// of the actual icon data.
 	

Modified: trunk/src/TagStore.cs
==============================================================================
--- trunk/src/TagStore.cs	(original)
+++ trunk/src/TagStore.cs	Wed Apr 30 14:10:00 2008
@@ -3,7 +3,6 @@
 using Gtk;
 using Mono.Unix;
 using Mono.Data.SqliteClient;
-using System.Collections.Generic;
 using System.Collections;
 using System.IO;
 using System;
@@ -133,7 +132,7 @@
 
 	public Tag [] GetTagsByNameStart (string s)
 	{
-		List <Tag> l = new List<Tag> ();
+		ArrayList l = new ArrayList ();
 		foreach (Tag t in this.item_cache.Values) {
 			if (t.Name.ToLower ().StartsWith (s.ToLower ()))
 				l.Add (t);
@@ -141,10 +140,8 @@
 
 		if (l.Count == 0)
 			return null;
-		
-		l.Sort (delegate (Tag t1, Tag t2) {return t2.Popularity.CompareTo (t1.Popularity); });
 
-		return l.ToArray ();
+		return (Tag []) (l.ToArray (typeof (Tag)));
 	}
 
 	// In this store we keep all the items (i.e. the tags) in memory at all times.  This is
@@ -156,7 +153,7 @@
 
 		// Pass 1, get all the tags.
 
-		SqliteDataReader reader = Database.Query("SELECT id, name, is_category, sort_priority, icon, count(*) as popularity FROM tags LEFT OUTER JOIN photo_tags ON photo_tags.tag_id = tags.id group by id order by sort_priority, popularity desc");
+		SqliteDataReader reader = Database.Query("SELECT id, name, is_category, sort_priority, icon FROM tags");
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader [0]);
@@ -173,7 +170,6 @@
 				SetIconFromString (tag, reader [4].ToString ());
 
 			tag.SortPriority = Convert.ToInt32 (reader[3]);
-			tag.Popularity = Convert.ToInt32 (reader[5]);
 			AddToCache (tag);
 		}
 



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