[f-spot/stable-0.8] Remove fully qualified Hyena.Data.Sqlite references



commit 84166472e6f3be1564b3138cf638ef473ab9106b
Author: Ruben Vermeersch <ruben savanne be>
Date:   Sun Nov 14 12:47:53 2010 +0100

    Remove fully qualified Hyena.Data.Sqlite references
    
    Don't like those.

 src/Clients/MainApp/FSpot.Database/Updater.cs      |    7 ++---
 .../MainApp/FSpot.Widgets/FolderTreeModel.cs       |    4 +-
 src/Clients/MainApp/FSpot/ExportStore.cs           |    7 ++---
 src/Clients/MainApp/FSpot/JobStore.cs              |    6 +---
 src/Clients/MainApp/FSpot/MetaStore.cs             |    5 +--
 src/Clients/MainApp/FSpot/PhotoStore.cs            |   25 +++++++++----------
 src/Clients/MainApp/FSpot/RollStore.cs             |    8 ++----
 src/Clients/MainApp/FSpot/TagStore.cs              |    6 +---
 8 files changed, 29 insertions(+), 39 deletions(-)
---
diff --git a/src/Clients/MainApp/FSpot.Database/Updater.cs b/src/Clients/MainApp/FSpot.Database/Updater.cs
index 9a07530..33400bd 100644
--- a/src/Clients/MainApp/FSpot.Database/Updater.cs
+++ b/src/Clients/MainApp/FSpot.Database/Updater.cs
@@ -1,7 +1,6 @@
 using Mono.Unix;
 using Gtk;
 using System;
-using System.Data;
 using System.Collections;
 
 using FSpot.Utils;
@@ -157,7 +156,7 @@ namespace FSpot.Database {
 					"       uri             STRING NOT NULL " +
 					")");
 
-				Hyena.Data.Sqlite.IDataReader reader = ExecuteReader (String.Format (
+				IDataReader reader = ExecuteReader (String.Format (
 						"SELECT photo_id, version_id, name, uri " +
 						"FROM {0}, photos " +
 						"WHERE photo_id = id ", tmp_versions));
@@ -526,7 +525,7 @@ namespace FSpot.Database {
 					"	UNIQUE (photo_id, version_id)\n" +
 					")");
 
-				Hyena.Data.Sqlite.IDataReader reader = ExecuteReader (String.Format (
+				IDataReader reader = ExecuteReader (String.Format (
 					"SELECT id, time, uri, description, roll_id, default_version_id, rating, md5_sum " +
 					"FROM {0} ", tmp_photos));
 
@@ -800,7 +799,7 @@ namespace FSpot.Database {
 			return db.Execute(statement);
 		}
 
-		private static Hyena.Data.Sqlite.IDataReader ExecuteReader (string statement)
+		private static 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 5aead42..32ae709 100644
--- a/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
+++ b/src/Clients/MainApp/FSpot.Widgets/FolderTreeModel.cs
@@ -8,7 +8,6 @@
  */
 
 using System;
-using System.Data;
 using System.Collections.Generic;
 
 using Gtk;
@@ -18,6 +17,7 @@ using FSpot;
 using FSpot.Database;
 using FSpot.Core;
 using Hyena;
+using Hyena.Data.Sqlite;
 
 using Mono.Unix;
 
@@ -106,7 +106,7 @@ namespace FSpot.Widgets
 
 			int last_count = 0;
 
-			Hyena.Data.Sqlite.IDataReader reader = database.Database.Query (query_string);
+			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 1a56589..dd1f7ca 100644
--- a/src/Clients/MainApp/FSpot/ExportStore.cs
+++ b/src/Clients/MainApp/FSpot/ExportStore.cs
@@ -2,7 +2,6 @@ using Gdk;
 using Gtk;
 using System.Collections;
 using System.IO;
-using System.Data;
 using System;
 using FSpot;
 using FSpot.Core;
@@ -66,7 +65,7 @@ public class ExportStore : DbStore<ExportItem> {
 			")");
 	}
 
-	private ExportItem LoadItem (Hyena.Data.Sqlite.IDataReader reader)
+	private ExportItem LoadItem (IDataReader reader)
 	{
 		return new ExportItem (Convert.ToUInt32 (reader["id"]),
 				       Convert.ToUInt32 (reader["image_id"]),
@@ -77,7 +76,7 @@ public class ExportStore : DbStore<ExportItem> {
 
 	private void LoadAllItems ()
 	{
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT id, image_id, image_version_id, export_type, export_token FROM exports");
+		IDataReader reader = Database.Query("SELECT id, image_id, image_version_id, export_type, export_token FROM exports");
 
 		while (reader.Read ()) {
 			AddToCache (LoadItem (reader));
@@ -116,7 +115,7 @@ public class ExportStore : DbStore<ExportItem> {
 	public ArrayList GetByImageId (uint image_id, uint 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 = ?",
+		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 ()) {
diff --git a/src/Clients/MainApp/FSpot/JobStore.cs b/src/Clients/MainApp/FSpot/JobStore.cs
index 61d3ac0..104a14a 100644
--- a/src/Clients/MainApp/FSpot/JobStore.cs
+++ b/src/Clients/MainApp/FSpot/JobStore.cs
@@ -10,7 +10,6 @@
 
 using System.Collections;
 using System.IO;
-using System.Data;
 using System;
 using Banshee.Kernel;
 using FSpot.Jobs;
@@ -18,7 +17,6 @@ using FSpot.Database;
 using FSpot;
 using FSpot.Core;
 using Hyena;
-
 using Hyena.Data.Sqlite;
 
 namespace FSpot {
@@ -106,7 +104,7 @@ public class JobStore : DbStore<Job> {
 			")");
 	}
 
-	private Job LoadItem (Hyena.Data.Sqlite.IDataReader reader)
+	private Job LoadItem (IDataReader reader)
 	{
 		return (Job) Activator.CreateInstance (
 				Type.GetType (reader ["job_type"].ToString ()),
@@ -119,7 +117,7 @@ public class JobStore : DbStore<Job> {
 
 	private void LoadAllItems ()
 	{
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT id, job_type, job_options, run_at, job_priority FROM jobs");
+		IDataReader reader = Database.Query ("SELECT id, job_type, job_options, run_at, job_priority FROM jobs");
 
 		Scheduler.Suspend ();
 		while (reader.Read ()) {
diff --git a/src/Clients/MainApp/FSpot/MetaStore.cs b/src/Clients/MainApp/FSpot/MetaStore.cs
index fde074c..3ae9f17 100644
--- a/src/Clients/MainApp/FSpot/MetaStore.cs
+++ b/src/Clients/MainApp/FSpot/MetaStore.cs
@@ -2,7 +2,6 @@ using Gdk;
 using Gtk;
 using System.Collections;
 using System.IO;
-using System.Data;
 using System;
 using FSpot;
 using FSpot.Core;
@@ -86,7 +85,7 @@ public class MetaStore : DbStore<MetaItem> {
 
 	private void LoadAllItems ()
 	{
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT id, name, data FROM meta");
+		IDataReader reader = Database.Query("SELECT id, name, data FROM meta");
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["id"]);
@@ -162,4 +161,4 @@ public class MetaStore : DbStore<MetaItem> {
 			LoadAllItems ();
 	}
 }
-}
\ No newline at end of file
+}
diff --git a/src/Clients/MainApp/FSpot/PhotoStore.cs b/src/Clients/MainApp/FSpot/PhotoStore.cs
index dfb751e..a1749d6 100644
--- a/src/Clients/MainApp/FSpot/PhotoStore.cs
+++ b/src/Clients/MainApp/FSpot/PhotoStore.cs
@@ -18,7 +18,6 @@ using System.Collections;
 using System.Collections.Generic;
 using System.IO;
 using System.Text;
-using System.Data;
 using System;
 
 using FSpot;
@@ -36,7 +35,7 @@ namespace FSpot {
 public class PhotoStore : DbStore<Photo> {
 	public int TotalPhotos {
 		get {
-			Hyena.Data.Sqlite.IDataReader reader = Database.Query("SELECT COUNT(*) AS photo_count FROM photos");
+			IDataReader reader = Database.Query("SELECT COUNT(*) AS photo_count FROM photos");
 			reader.Read ();
 			int total = Convert.ToInt32 (reader ["photo_count"]);
 			reader.Dispose ();
@@ -202,7 +201,7 @@ public class PhotoStore : DbStore<Photo> {
 
 	private void GetVersions (Photo photo)
 	{
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query(
+		IDataReader reader = Database.Query(
 			new HyenaSqliteCommand("SELECT version_id, name, base_uri, filename, import_md5, protected " +
 				      "FROM photo_versions " +
 				      "WHERE photo_id = ?",
@@ -225,7 +224,7 @@ public class PhotoStore : DbStore<Photo> {
 
 	private void GetTags (Photo photo)
 	{
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query(new HyenaSqliteCommand("SELECT tag_id FROM photo_tags WHERE photo_id = ?", photo.Id));
+		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"]);
@@ -236,7 +235,7 @@ public class PhotoStore : DbStore<Photo> {
 	}
 
 	private void GetAllVersions  (string 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);
+		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"]);
@@ -274,7 +273,7 @@ public class PhotoStore : DbStore<Photo> {
 	}
 
 	private void GetAllTags (string ids) {
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT photo_id, tag_id FROM photo_tags WHERE photo_id IN " + ids);
+		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"]);
@@ -305,7 +304,7 @@ public class PhotoStore : DbStore<Photo> {
 		if (photo != null)
 			return photo;
 
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query(
+		IDataReader reader = Database.Query(
 			new HyenaSqliteCommand("SELECT time, description, roll_id, default_version_id, rating " +
 				      "FROM photos " +
 				      "WHERE id = ?", id
@@ -338,7 +337,7 @@ public class PhotoStore : DbStore<Photo> {
 		var base_uri = uri.GetBaseUri ();
 		var filename = uri.GetFilename ();
 
-		Hyena.Data.Sqlite.IDataReader reader =
+		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" +
@@ -548,7 +547,7 @@ public class PhotoStore : DbStore<Photo> {
 			where_added = true;
 		}
 
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query_builder.ToString());
+		IDataReader reader = Database.Query (query_builder.ToString());
 		reader.Read ();
 		int count = Convert.ToInt32 (reader ["count"]);
 		reader.Dispose();
@@ -586,7 +585,7 @@ public class PhotoStore : DbStore<Photo> {
 	private int IndexOf (string query)
 	{
 		uint timer = Log.DebugTimerStart ();
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query);
+		IDataReader reader = Database.Query (query);
 		int index = - 1;
 		if (reader.Read ())
 			index = Convert.ToInt32 (reader ["row_id"]);
@@ -599,7 +598,7 @@ public class PhotoStore : DbStore<Photo> {
 	{
 		uint timer = Log.DebugTimerStart ();
 		List<int> list = new List<int> ();
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query (query);
+		IDataReader reader = Database.Query (query);
 		while (reader.Read ())
 			list.Add (Convert.ToInt32 (reader ["row_id"]) - 1);
 		reader.Dispose ();
@@ -630,7 +629,7 @@ public class PhotoStore : DbStore<Photo> {
 		int minyear = Int32.MaxValue;
 		int maxyear = Int32.MinValue;
 
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT COUNT (*) as count, month from population GROUP BY month");
+		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"]);
@@ -756,7 +755,7 @@ public class PhotoStore : DbStore<Photo> {
 	private Photo [] Query (HyenaSqliteCommand query)
 	{
 		uint timer = Log.DebugTimerStart ();
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query(query);
+		IDataReader reader = Database.Query(query);
 
 		List<Photo> new_photos = new List<Photo> ();
 		List<Photo> query_result = new List<Photo> ();
diff --git a/src/Clients/MainApp/FSpot/RollStore.cs b/src/Clients/MainApp/FSpot/RollStore.cs
index 397f68c..3ab67b7 100644
--- a/src/Clients/MainApp/FSpot/RollStore.cs
+++ b/src/Clients/MainApp/FSpot/RollStore.cs
@@ -11,7 +11,6 @@
 
 using System.Collections;
 using System.IO;
-using System.Data;
 using System;
 
 using FSpot.Core;
@@ -20,7 +19,6 @@ using FSpot.Utils;
 using FSpot;
 
 using Hyena;
-
 using Hyena.Data.Sqlite;
 
 namespace FSpot {
@@ -60,7 +58,7 @@ public class RollStore : DbStore<Roll>
 		if (roll != null)
 			return roll;
 
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query(new HyenaSqliteCommand ("SELECT time FROM rolls WHERE id = ?", id));
+		IDataReader reader = Database.Query(new HyenaSqliteCommand ("SELECT time FROM rolls WHERE id = ?", id));
 
 		if (reader.Read ()) {
 			roll = new Roll (id, Convert.ToUInt32 (reader ["time"]));
@@ -86,7 +84,7 @@ public class RollStore : DbStore<Roll>
 	public uint PhotosInRoll (Roll roll)
 	{
 		uint number_of_photos = 0;
-		using (Hyena.Data.Sqlite.IDataReader reader = Database.Query (new HyenaSqliteCommand ("SELECT count(*) AS count FROM photos WHERE roll_id = ?", roll.Id))) {
+		using (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"]);
 
@@ -108,7 +106,7 @@ public class RollStore : DbStore<Roll>
 		if (limit >= 0)
 			query += " LIMIT " + limit;
 
-		using (Hyena.Data.Sqlite.IDataReader reader = Database.Query(query)) {
+		using (IDataReader reader = Database.Query(query)) {
 			while (reader.Read ()) {
 				uint id = Convert.ToUInt32 (reader["roll_id"]);
 
diff --git a/src/Clients/MainApp/FSpot/TagStore.cs b/src/Clients/MainApp/FSpot/TagStore.cs
index 608a74a..6e280d6 100644
--- a/src/Clients/MainApp/FSpot/TagStore.cs
+++ b/src/Clients/MainApp/FSpot/TagStore.cs
@@ -4,7 +4,6 @@ using Mono.Unix;
 using System.Collections.Generic;
 using System.Collections;
 using System.IO;
-using System.Data;
 using System;
 using FSpot;
 using FSpot.Core;
@@ -13,7 +12,6 @@ using FSpot.Jobs;
 using FSpot.Query;
 using FSpot.Utils;
 using Hyena;
-
 using Hyena.Data.Sqlite;
 
 namespace FSpot {
@@ -129,7 +127,7 @@ public class TagStore : DbStore<Tag> {
 
 		// Pass 1, get all the tags.
 
-		Hyena.Data.Sqlite.IDataReader reader = Database.Query ("SELECT id, name, is_category, sort_priority, icon FROM tags");
+		IDataReader reader = Database.Query ("SELECT id, name, is_category, sort_priority, icon FROM tags");
 
 		while (reader.Read ()) {
 			uint id = Convert.ToUInt32 (reader ["id"]);
@@ -394,4 +392,4 @@ public class TagStore : DbStore<Tag> {
 		EmitChanged (tags);
 	}
 }
-}
\ No newline at end of file
+}



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