[tasque/transition: 178/213] [SQLite] Add categories parameter to support legacy behavior



commit 1ac6d57874c9e666cc87148d19c9996f6169f082
Author: Antonius Riha <antoniusriha gmail com>
Date:   Sat Aug 18 23:47:42 2012 +0200

    [SQLite] Add categories parameter to support legacy behavior

 src/Addins/DummyBackend/DummyBackend.cs |    3 ++-
 src/Addins/SqliteBackend/SqliteTask.cs  |    3 +--
 src/libtasque/Backend.cs                |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/Addins/DummyBackend/DummyBackend.cs b/src/Addins/DummyBackend/DummyBackend.cs
index 92c7128..4708e25 100644
--- a/src/Addins/DummyBackend/DummyBackend.cs
+++ b/src/Addins/DummyBackend/DummyBackend.cs
@@ -26,6 +26,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 using System;
+using System.Collections.Generic;
 using Tasque.Backends.Dummy.Gtk;
 
 namespace Tasque.Backends.Dummy
@@ -117,7 +118,7 @@ namespace Tasque.Backends.Dummy
 		}
 		#endregion
 
-		protected override Task CreateTaskCore (string taskName)
+		protected override Task CreateTaskCore (string taskName, IEnumerable<Category> categories)
 		{
 			return new DummyTask (taskName);
 		}
diff --git a/src/Addins/SqliteBackend/SqliteTask.cs b/src/Addins/SqliteBackend/SqliteTask.cs
index 50f70cb..1b67d53 100644
--- a/src/Addins/SqliteBackend/SqliteTask.cs
+++ b/src/Addins/SqliteBackend/SqliteTask.cs
@@ -7,7 +7,7 @@ namespace Tasque.Backends.Sqlite
 {
 	public class SqliteTask : Task
 	{
-		public SqliteTask (SqliteBackend backend, string name)
+		public SqliteTask (SqliteBackend backend, string name, int category)
 			: base (backend.SanitizeText (name), TaskNoteSupport.Multiple)
 		{
 			if (backend == null)
@@ -18,7 +18,6 @@ namespace Tasque.Backends.Sqlite
 			Debug.WriteLine ("Creating New Task Object : {0} (id={1})", name, id);
 			var dueDate = Database.FromDateTime (DueDate);
 			var completionDate = Database.FromDateTime (CompletionDate);
-			var category = 0;
 			var priority = (int)Priority;
 			var state = (int)State;
 			var command = string.Format ("INSERT INTO Tasks (Name, DueDate, CompletionDate, Priority, State, Category, ExternalID) values ('{0}','{1}', '{2}','{3}', '{4}', '{5}', '{6}'); SELECT last_insert_rowid();", 
diff --git a/src/libtasque/Backend.cs b/src/libtasque/Backend.cs
index e986faf..ab77068 100644
--- a/src/libtasque/Backend.cs
+++ b/src/libtasque/Backend.cs
@@ -151,7 +151,7 @@ namespace Tasque
 			if (categories == null)
 				throw new ArgumentNullException ("categories");
 
-			var task = CreateTaskCore (taskName);
+			var task = CreateTaskCore (taskName, categories);
 
 			bool isEmpty = true;
 			foreach (var item in categories) {
@@ -193,7 +193,7 @@ namespace Tasque
 		/// </summary>
 		public virtual void Refresh () {}
 
-		protected abstract Task CreateTaskCore (string taskName);
+		protected abstract Task CreateTaskCore (string taskName, IEnumerable<Category> categories);
 		
 		protected void OnBackendInitialized () {
 			if (BackendInitialized != null)



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