[f-spot/stable-0.8] Using Hyena master with new sqlite db layer



commit f61491888c9db22376b8249f2ac02f1738ec9d24
Author: Tim Howard <timothy howard gmail com>
Date:   Sat Nov 13 23:20:51 2010 -0500

    Using Hyena master with new sqlite db layer

 F-Spot.sln                                         |    9 ---
 lib/Hyena                                          |    2 +-
 src/Clients/MainApp/FSpot.Database/Updater.cs      |   10 ++--
 .../MainApp/FSpot.Widgets/FolderTreeModel.cs       |    2 +-
 src/Clients/MainApp/FSpot/ExportStore.cs           |   10 ++--
 src/Clients/MainApp/FSpot/JobStore.cs              |    6 +-
 src/Clients/MainApp/FSpot/MetaStore.cs             |    4 +-
 src/Clients/MainApp/FSpot/PhotoStore.cs            |   52 ++++++++++----------
 src/Clients/MainApp/FSpot/RollStore.cs             |   12 +++--
 src/Clients/MainApp/FSpot/TagStore.cs              |    8 ++--
 10 files changed, 54 insertions(+), 61 deletions(-)
---
diff --git a/F-Spot.sln b/F-Spot.sln
index 76e6045..fe303b0 100644
--- a/F-Spot.sln
+++ b/F-Spot.sln
@@ -25,8 +25,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyena", "lib\Hyena\Hyena\Hy
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyena.Data.Sqlite", "lib\Hyena\Hyena.Data.Sqlite\Hyena.Data.Sqlite.csproj", "{95374549-9553-4C1E-9D89-667755F90E13}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Data.Sqlite", "lib\Hyena\Mono.Data.Sqlite\Mono.Data.Sqlite.csproj", "{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TagLib", "lib\TagLib\TagLib.csproj", "{903D6440-A981-4B29-8825-7EB820684925}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hyena.Gui", "lib\Hyena\Hyena.Gui\Hyena.Gui.csproj", "{C856EFD8-E812-4E61-8B76-E3583D94C233}"
@@ -284,12 +282,6 @@ Global
 		{B850C11B-69B7-45A4-AB1D-1BECA8C667C0}.Release|Any CPU.Build.0 = Release|Any CPU
 		{B850C11B-69B7-45A4-AB1D-1BECA8C667C0}.Submodule|Any CPU.ActiveCfg = Debug|Any CPU
 		{B850C11B-69B7-45A4-AB1D-1BECA8C667C0}.Submodule|Any CPU.Build.0 = Debug|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Debug|Any CPU.ActiveCfg = Submodule|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Debug|Any CPU.Build.0 = Submodule|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Release|Any CPU.ActiveCfg = Debug|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Release|Any CPU.Build.0 = Debug|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Submodule|Any CPU.ActiveCfg = Submodule|Any CPU
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1}.Submodule|Any CPU.Build.0 = Submodule|Any CPU
 		{BE981FC8-9B41-4336-815C-ECC365AE05D4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{BE981FC8-9B41-4336-815C-ECC365AE05D4}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{BE981FC8-9B41-4336-815C-ECC365AE05D4}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -344,7 +336,6 @@ Global
 		{05A7FEC4-974A-40EB-AFB8-14E523EEEFFB} = {6DC9A109-EC89-4221-B8CD-9E88B589DBC1}
 		{95374549-9553-4C1E-9D89-667755F90E12} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
 		{95374549-9553-4C1E-9D89-667755F90E13} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
-		{BB1D1D81-7A74-4183-B7B1-3E78B32D42F1} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
 		{903D6440-A981-4B29-8825-7EB820684925} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
 		{C856EFD8-E812-4E61-8B76-E3583D94C233} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
 		{40C7D4EA-FB93-49FE-B18F-700A28C3E670} = {6369E0D4-0A68-4D4E-A6A0-EF2EA793002F}
diff --git a/lib/Hyena b/lib/Hyena
index 899dea6..5367685 160000
--- a/lib/Hyena
+++ b/lib/Hyena
@@ -1 +1 @@
-Subproject commit 899dea664aaa4a042e1ba1dd49f16de9d625cf81
+Subproject commit 5367685a22bdfd831eeeba75bb5c32e674638ebe
diff --git a/src/Clients/MainApp/FSpot.Database/Updater.cs b/src/Clients/MainApp/FSpot.Database/Updater.cs
index faa5faa..9a07530 100644
--- a/src/Clients/MainApp/FSpot.Database/Updater.cs
+++ b/src/Clients/MainApp/FSpot.Database/Updater.cs
@@ -157,7 +157,7 @@ namespace FSpot.Database {
 					"       uri             STRING NOT NULL " +
 					")");
 
-				IDataReader reader = ExecuteReader (String.Format (
+				Hyena.Data.Sqlite.IDataReader reader = ExecuteReader (String.Format (
 						"SELECT photo_id, version_id, name, uri " +
 						"FROM {0}, photos " +
 						"WHERE photo_id = id ", tmp_versions));
@@ -526,7 +526,7 @@ namespace FSpot.Database {
 					"	UNIQUE (photo_id, version_id)\n" +
 					")");
 
-				IDataReader reader = ExecuteReader (String.Format (
+				Hyena.Data.Sqlite.IDataReader reader = ExecuteReader (String.Format (
 					"SELECT id, time, uri, description, roll_id, default_version_id, rating, md5_sum " +
 					"FROM {0} ", tmp_photos));
 
@@ -552,7 +552,7 @@ namespace FSpot.Database {
 						String.IsNullOrEmpty (md5) ? null : md5));
 				}
 
-				reader.Close ();
+                reader.Dispose();
 
 				reader = ExecuteReader (String.Format (
 						"SELECT photo_id, version_id, name, uri, md5_sum, protected " +
@@ -658,7 +658,7 @@ namespace FSpot.Database {
 						Convert.ToUInt32 (reader ["rating"])));
 				}
 
-				reader.Close ();
+				reader.Dispose();
 
 				reader = ExecuteReader (String.Format (
 						"SELECT photo_id, version_id, name, base_uri, filename, protected " +
@@ -800,7 +800,7 @@ namespace FSpot.Database {
 			return db.Execute(statement);
 		}
 
-		private static IDataReader ExecuteReader (string statement)
+		private static Hyena.Data.Sqlite.IDataReader ExecuteReader (string statement)
 		{
 			return db.Query (statement);
 		}
diff --git a/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs b/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
index 3be8593..5aead42 100644
--- a/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
@@ -106,7 +106,7 @@ namespace FSpot.Widgets
 
 			int last_count = 0;
 
-			IDataReader reader = database.Database.Query (query_string);
+			Hyena.Data.Sqlite.IDataReader reader = database.Database.Query (query_string);
 
 			while (reader.Read ()) {
 				var base_uri = new SafeUri (reader["base_uri"].ToString (), true);
diff --git a/src/Clients/MainApp/FSpot/ExportStore.cs b/src/Clients/MainApp/FSpot/ExportStore.cs
index 7fbff5d..1a56589 100644
--- a/src/Clients/MainApp/FSpot/ExportStore.cs
+++ b/src/Clients/MainApp/FSpot/ExportStore.cs
@@ -66,7 +66,7 @@ public class ExportStore : DbStore<ExportItem> {
 			")");
 	}
 
-	private ExportItem LoadItem (IDataReader reader)
+	private ExportItem LoadItem (Hyena.Data.Sqlite.IDataReader reader)
 	{
 		return new ExportItem (Convert.ToUInt32 (reader["id"]),
 				       Convert.ToUInt32 (reader["image_id"]),
@@ -77,13 +77,13 @@ public class ExportStore : DbStore<ExportItem> {
 
 	private void LoadAllItems ()
 	{
-		IDataReader reader = Database.Query("SELECT id, image_id, image_version_id, export_type, export_token FROM exports");
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT id, image_id, image_version_id, export_type, export_token FROM exports");
 
 		while (reader.Read ()) {
 			AddToCache (LoadItem (reader));
 		}
 
-		reader.Close ();
+		reader.Dispose ();
 	}
 
 	public ExportItem Create (uint image_id, uint image_version_id, string export_type, string export_token)
@@ -116,13 +116,13 @@ public class ExportStore : DbStore<ExportItem> {
 	public ArrayList GetByImageId (uint image_id, uint image_version_id)
 	{
 
-		IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT id, image_id, image_version_id, export_type, export_token FROM exports WHERE image_id = ? AND image_version_id = ?",
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT id, image_id, image_version_id, export_type, export_token FROM exports WHERE image_id = ? AND image_version_id = ?",
                     image_id, image_version_id));
 		ArrayList list = new ArrayList ();
 		while (reader.Read ()) {
 			list.Add (LoadItem (reader));
 		}
-		reader.Close ();
+		reader.Dispose ();
 
 		return list;
 	}
diff --git a/src/Clients/MainApp/FSpot/JobStore.cs b/src/Clients/MainApp/FSpot/JobStore.cs
index 7fc11ab..61d3ac0 100644
--- a/src/Clients/MainApp/FSpot/JobStore.cs
+++ b/src/Clients/MainApp/FSpot/JobStore.cs
@@ -106,7 +106,7 @@ public class JobStore : DbStore<Job> {
 			")");
 	}
 
-	private Job LoadItem (IDataReader reader)
+	private Job LoadItem (Hyena.Data.Sqlite.IDataReader reader)
 	{
 		return (Job) Activator.CreateInstance (
 				Type.GetType (reader ["job_type"].ToString ()),
@@ -119,7 +119,7 @@ public class JobStore : DbStore<Job> {
 
 	private void LoadAllItems ()
 	{
-		IDataReader reader = Database.Query ("SELECT id, job_type, job_options, run_at, job_priority FROM jobs");
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT id, job_type, job_options, run_at, job_priority FROM jobs");
 
 		Scheduler.Suspend ();
 		while (reader.Read ()) {
@@ -130,7 +130,7 @@ public class JobStore : DbStore<Job> {
 			job.Status = JobStatus.Scheduled;
 		}
 
-		reader.Close ();
+		reader.Dispose ();
 	}
 
 	public Job Create (Type job_type, string job_options)
diff --git a/src/Clients/MainApp/FSpot/MetaStore.cs b/src/Clients/MainApp/FSpot/MetaStore.cs
index cc9847f..fde074c 100644
--- a/src/Clients/MainApp/FSpot/MetaStore.cs
+++ b/src/Clients/MainApp/FSpot/MetaStore.cs
@@ -86,7 +86,7 @@ public class MetaStore : DbStore<MetaItem> {
 
 	private void LoadAllItems ()
 	{
-		IDataReader reader = Database.Query("SELECT id, name, data FROM meta");
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT id, name, data FROM meta");
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["id"]);
@@ -102,7 +102,7 @@ public class MetaStore : DbStore<MetaItem> {
 			AddToCache (item);
 		}
 
-		reader.Close ();
+		reader.Dispose ();
 
 		if (FSpotVersion.Value != Defines.VERSION) {
 			FSpotVersion.Value = Defines.VERSION;
diff --git a/src/Clients/MainApp/FSpot/PhotoStore.cs b/src/Clients/MainApp/FSpot/PhotoStore.cs
index f604c20..dfb751e 100644
--- a/src/Clients/MainApp/FSpot/PhotoStore.cs
+++ b/src/Clients/MainApp/FSpot/PhotoStore.cs
@@ -36,10 +36,10 @@ namespace FSpot {
 public class PhotoStore : DbStore<Photo> {
 	public int TotalPhotos {
 		get {
-			IDataReader reader = Database.Query("SELECT COUNT(*) AS photo_count FROM photos");
+			Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT COUNT(*) AS photo_count FROM photos");
 			reader.Read ();
 			int total = Convert.ToInt32 (reader ["photo_count"]);
-			reader.Close ();
+			reader.Dispose ();
 			return total;
 		}
 	}
@@ -110,7 +110,7 @@ public class PhotoStore : DbStore<Photo> {
 		var reader = Database.Query (new HyenaSqliteCommand (query, uri.GetBaseUri ().ToString (), uri.GetFilename ()));
 		reader.Read ();
 		int count = Convert.ToInt32 (reader ["count"]);
-		reader.Close();
+		reader.Dispose();
 		if (count > 0)
 			return true;
 
@@ -148,7 +148,7 @@ public class PhotoStore : DbStore<Photo> {
 					return true;
 				}
 			}
-			reader.Close ();
+			reader.Dispose ();
 		}
 
 		// No matches
@@ -202,7 +202,7 @@ public class PhotoStore : DbStore<Photo> {
 
 	private void GetVersions (Photo photo)
 	{
-		IDataReader reader = Database.Query(
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(
 			new HyenaSqliteCommand("SELECT version_id, name, base_uri, filename, import_md5, protected " +
 				      "FROM photo_versions " +
 				      "WHERE photo_id = ?",
@@ -220,23 +220,23 @@ public class PhotoStore : DbStore<Photo> {
 
 			photo.AddVersionUnsafely (version_id, base_uri, filename, import_md5, name, is_protected);
 		}
-		reader.Close();
+		reader.Dispose();
 	}
 
 	private void GetTags (Photo photo)
 	{
-		IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT tag_id FROM photo_tags WHERE photo_id = ?", photo.Id));
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT tag_id FROM photo_tags WHERE photo_id = ?", photo.Id));
 
 		while (reader.Read ()) {
 			uint tag_id = Convert.ToUInt32 (reader ["tag_id"]);
 			Tag tag = App.Instance.Database.Tags.Get (tag_id) as Tag;
 			photo.AddTagUnsafely (tag);
 		}
-		reader.Close();
+		reader.Dispose();
 	}
 
 	private void GetAllVersions  (string ids) {
-		IDataReader reader = Database.Query ("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id IN " + ids);
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT photo_id, version_id, name, base_uri, filename, import_md5, protected FROM photo_versions WHERE photo_id IN " + ids);
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["photo_id"]);
@@ -270,11 +270,11 @@ public class PhotoStore : DbStore<Photo> {
 			System.Console.WriteLine ("directory_path = {0}", directory_path);
 			*/
 		}
-		reader.Close();
+		reader.Dispose();
 	}
 
 	private void GetAllTags (string ids) {
-		IDataReader reader = Database.Query ("SELECT photo_id, tag_id FROM photo_tags WHERE photo_id IN " + ids);
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT photo_id, tag_id FROM photo_tags WHERE photo_id IN " + ids);
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["photo_id"]);
@@ -296,7 +296,7 @@ public class PhotoStore : DbStore<Photo> {
 				photo.AddTagUnsafely (tag);
 			}
 		}
-		reader.Close();
+		reader.Dispose();
 	}
 
 	public override Photo Get (uint id)
@@ -305,7 +305,7 @@ public class PhotoStore : DbStore<Photo> {
 		if (photo != null)
 			return photo;
 
-		IDataReader reader = Database.Query(
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(
 			new HyenaSqliteCommand("SELECT time, description, roll_id, default_version_id, rating " +
 				      "FROM photos " +
 				      "WHERE id = ?", id
@@ -320,7 +320,7 @@ public class PhotoStore : DbStore<Photo> {
 			photo.Rating = Convert.ToUInt32 (reader ["rating"]);
 			AddToCache (photo);
 		}
-		reader.Close();
+		reader.Dispose();
 
 		if (photo == null)
 			return null;
@@ -338,7 +338,7 @@ public class PhotoStore : DbStore<Photo> {
 		var base_uri = uri.GetBaseUri ();
 		var filename = uri.GetFilename ();
 
-		IDataReader reader =
+		Hyena.Data.Sqlite.IDataReader reader =
 			Database.Query (new HyenaSqliteCommand ("SELECT id, time, description, roll_id, default_version_id, rating " +
 			                               " FROM photos " +
 			                               " LEFT JOIN photo_versions AS pv ON photos.id = pv.photo_id" +
@@ -357,7 +357,7 @@ public class PhotoStore : DbStore<Photo> {
 			photo.Rating = Convert.ToUInt32 (reader ["rating"]);
 		}
 
-		reader.Close();
+		reader.Dispose();
 
 		if (photo == null)
 			return null;
@@ -548,10 +548,10 @@ public class PhotoStore : DbStore<Photo> {
 			where_added = true;
 		}
 
-		IDataReader reader = Database.Query (query_builder.ToString());
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query_builder.ToString());
 		reader.Read ();
 		int count = Convert.ToInt32 (reader ["count"]);
-		reader.Close();
+		reader.Dispose();
 		return count;
 	}
 
@@ -586,11 +586,11 @@ public class PhotoStore : DbStore<Photo> {
 	private int IndexOf (string query)
 	{
 		uint timer = Log.DebugTimerStart ();
-		IDataReader reader = Database.Query (query);
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query);
 		int index = - 1;
 		if (reader.Read ())
 			index = Convert.ToInt32 (reader ["row_id"]);
-		reader.Close();
+		reader.Dispose();
 		Log.DebugTimerPrint (timer, "IndexOf took {0} : " + query);
 		return index - 1; //ROWID starts counting at 1
 	}
@@ -599,10 +599,10 @@ public class PhotoStore : DbStore<Photo> {
 	{
 		uint timer = Log.DebugTimerStart ();
 		List<int> list = new List<int> ();
-		IDataReader reader = Database.Query (query);
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query);
 		while (reader.Read ())
 			list.Add (Convert.ToInt32 (reader ["row_id"]) - 1);
-		reader.Close ();
+		reader.Dispose ();
 		Log.DebugTimerPrint (timer, "IndicesOf took {0} : " + query);
 		return list.ToArray ();
 	}
@@ -630,7 +630,7 @@ public class PhotoStore : DbStore<Photo> {
 		int minyear = Int32.MaxValue;
 		int maxyear = Int32.MinValue;
 
-		IDataReader reader = Database.Query ("SELECT COUNT (*) as count, month from population GROUP BY month");
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT COUNT (*) as count, month from population GROUP BY month");
 		while (reader.Read ()) {
 			string yyyymm = reader ["month"].ToString ();
 			int count = Convert.ToInt32 (reader ["count"]);
@@ -642,7 +642,7 @@ public class PhotoStore : DbStore<Photo> {
 				val.Add (year, new int[12]);
 			val[year][month-1] = count;
 		}
-		reader.Close ();
+		reader.Dispose ();
 
 		//Fill the blank
 		for (int i = minyear; i <= maxyear; i++)
@@ -756,7 +756,7 @@ public class PhotoStore : DbStore<Photo> {
 	private Photo [] Query (HyenaSqliteCommand query)
 	{
 		uint timer = Log.DebugTimerStart ();
-		IDataReader reader = Database.Query(query);
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(query);
 
 		List<Photo> new_photos = new List<Photo> ();
 		List<Photo> query_result = new List<Photo> ();
@@ -775,7 +775,7 @@ public class PhotoStore : DbStore<Photo> {
 
 			query_result.Add (photo);
 		}
-		reader.Close();
+		reader.Dispose();
 
 		bool need_load = false;
 		string photo_ids = "(";
diff --git a/src/Clients/MainApp/FSpot/RollStore.cs b/src/Clients/MainApp/FSpot/RollStore.cs
index b4dd0d1..397f68c 100644
--- a/src/Clients/MainApp/FSpot/RollStore.cs
+++ b/src/Clients/MainApp/FSpot/RollStore.cs
@@ -60,13 +60,15 @@ public class RollStore : DbStore<Roll>
 		if (roll != null)
 			return roll;
 
-		IDataReader reader = Database.Query(new HyenaSqliteCommand ("SELECT time FROM rolls WHERE id = ?", id));
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query(new HyenaSqliteCommand ("SELECT time FROM rolls WHERE id = ?", id));
 
 		if (reader.Read ()) {
 			roll = new Roll (id, Convert.ToUInt32 (reader ["time"]));
 			AddToCache (roll);
 		}
 
+        reader.Dispose();
+
 		return roll;
 	}
 
@@ -84,11 +86,11 @@ public class RollStore : DbStore<Roll>
 	public uint PhotosInRoll (Roll roll)
 	{
 		uint number_of_photos = 0;
-		using (IDataReader reader = Database.Query (new HyenaSqliteCommand ("SELECT count(*) AS count FROM photos WHERE roll_id = ?", roll.Id))) {
+		using (Hyena.Data.Sqlite.IDataReader reader = Database.Query (new HyenaSqliteCommand ("SELECT count(*) AS count FROM photos WHERE roll_id = ?", roll.Id))) {
 			if (reader.Read ())
 				number_of_photos = Convert.ToUInt32 (reader ["count"]);
 
-			reader.Close ();
+			reader.Dispose ();
 		}
                 return number_of_photos;
 	}
@@ -106,7 +108,7 @@ public class RollStore : DbStore<Roll>
 		if (limit >= 0)
 			query += " LIMIT " + limit;
 
-		using (IDataReader reader = Database.Query(query)) {
+		using (Hyena.Data.Sqlite.IDataReader reader = Database.Query(query)) {
 			while (reader.Read ()) {
 				uint id = Convert.ToUInt32 (reader["roll_id"]);
 
@@ -117,7 +119,7 @@ public class RollStore : DbStore<Roll>
 				}
 				list.Add (roll);
 			}
-			reader.Close ();
+			reader.Dispose ();
 		}
 		return (Roll []) list.ToArray (typeof (Roll));
 	}
diff --git a/src/Clients/MainApp/FSpot/TagStore.cs b/src/Clients/MainApp/FSpot/TagStore.cs
index 958eecf..608a74a 100644
--- a/src/Clients/MainApp/FSpot/TagStore.cs
+++ b/src/Clients/MainApp/FSpot/TagStore.cs
@@ -129,7 +129,7 @@ public class TagStore : DbStore<Tag> {
 
 		// Pass 1, get all the tags.
 
-		IDataReader reader = Database.Query ("SELECT id, name, is_category, sort_priority, icon FROM tags");
+		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT id, name, is_category, sort_priority, icon FROM tags");
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["id"]);
@@ -153,7 +153,7 @@ public class TagStore : DbStore<Tag> {
 			AddToCache (tag);
 		}
 
-		reader.Close ();
+		reader.Dispose ();
 
 		// Pass 2, set the parents.
 		reader = Database.Query ("SELECT id, category_id FROM tags");
@@ -174,7 +174,7 @@ public class TagStore : DbStore<Tag> {
 			}
 
 		}
-		reader.Close ();
+		reader.Dispose ();
 
 		//Pass 3, set popularity
 		reader = Database.Query ("SELECT tag_id, COUNT (*) AS popularity FROM photo_tags GROUP BY tag_id");
@@ -183,7 +183,7 @@ public class TagStore : DbStore<Tag> {
 			if (t != null)
 				t.Popularity = Convert.ToInt32 (reader ["popularity"]);
 		}
-		reader.Close ();
+		reader.Dispose ();
 
 		if (FSpot.App.Instance.Database.Meta.HiddenTagId.Value != null)
 			hidden = LookupInCache ((uint) FSpot.App.Instance.Database.Meta.HiddenTagId.ValueAsInt) as Tag;



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