tasque r209 - in trunk: . src/Backends/EDS
- From: jjohnny svn gnome org
- To: svn-commits-list gnome org
- Subject: tasque r209 - in trunk: . src/Backends/EDS
- Date: Fri, 16 Jan 2009 06:27:19 +0000 (UTC)
Author: jjohnny
Date: Fri Jan 16 06:27:19 2009
New Revision: 209
URL: http://svn.gnome.org/viewvc/tasque?rev=209&view=rev
Log:
EDS : Fix for 567730. In CreateTask, use defaultCategory when AllCategory is used.
Modified:
trunk/ChangeLog
trunk/src/Backends/EDS/EDSBackends.cs
trunk/src/Backends/EDS/EDSCategory.cs
Modified: trunk/src/Backends/EDS/EDSBackends.cs
==============================================================================
--- trunk/src/Backends/EDS/EDSBackends.cs (original)
+++ trunk/src/Backends/EDS/EDSBackends.cs Fri Jan 16 06:27:19 2009
@@ -30,6 +30,8 @@
private Gtk.ListStore categoryListStore;
private Gtk.TreeModelSort sortedCategoriesModel;
+ private EDSCategory defaultCategory;
+
public event BackendInitializedHandler BackendInitialized;
public event BackendSyncStartedHandler BackendSyncStarted;
public event BackendSyncFinishedHandler BackendSyncFinished;
@@ -51,6 +53,8 @@
sortedCategoriesModel = new Gtk.TreeModelSort (categoryListStore);
sortedCategoriesModel.SetSortFunc (0, new Gtk.TreeIterCompareFunc (CompareCategorySortFunc));
sortedCategoriesModel.SetSortColumnId (0, Gtk.SortType.Ascending);
+
+ defaultCategory = null;
}
#region Public Properties
@@ -91,10 +95,14 @@
Gtk.TreeIter taskIter;
EDSTask edsTask;
- //FIXME : AllCategory
- if (category == null || category is Tasque.AllCategory)
+ if (category == null )
return null;
+ if (category is Tasque.AllCategory && defaultCategory != null)
+ category = this.defaultCategory;
+ else
+ return null;
+
EDSCategory edsCategory = category as EDSCategory;
CalComponent task = new CalComponent (edsCategory.TaskList);
task.Summary = taskName;
@@ -324,6 +332,10 @@
iter = categoryListStore.Append ();
categoryListStore.SetValue (iter, 0, edsCategory);
+ //Assumption : EDS Creates atleast one System category.
+ if (edsCategory.IsSystem)
+ this.defaultCategory = edsCategory;
+
if (!taskList.Open (true)) {
Logger.Debug ("laskList Open failed");
return;
Modified: trunk/src/Backends/EDS/EDSCategory.cs
==============================================================================
--- trunk/src/Backends/EDS/EDSCategory.cs (original)
+++ trunk/src/Backends/EDS/EDSCategory.cs Fri Jan 16 06:27:19 2009
@@ -16,12 +16,17 @@
private string name;
private string uid;
private Evolution.Cal taskList;
+ private bool isSystem;
public EDSCategory (Evolution.Source source, Evolution.Cal taskList)
{
this.name = source.Name;
this.uid = source.Uid;
this.taskList = taskList;
+
+ //Based on evolution/calendar/gui/e-cal-popup.c :
+ //e_cal_popup_target_new_source
+ this.isSystem = (string.Compare (source.RelativeUri, "system") == 0);
}
public EDSCategory (Evolution.Source source)
@@ -29,8 +34,14 @@
this.name = source.Name;
this.uid = source.Uid;
this.taskList = new Cal (source, CalSourceType.Todo);
+ this.isSystem = (string.Compare (source.RelativeUri, "system") == 0);
}
+ public bool IsSystem
+ {
+ get { return isSystem; }
+ }
+
public string Name
{
get { return name; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]