aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/corba-cal.c
diff options
context:
space:
mode:
authorEskil Heyn Olsen <eskil@src.gnome.org>2000-01-05 20:12:44 +0800
committerEskil Heyn Olsen <eskil@src.gnome.org>2000-01-05 20:12:44 +0800
commit36e5e42d31a56499b1b2534fdf9f6a720b3813e0 (patch)
tree9dbd0c4bea9781c1f5ddf321429fdeb165afdaec /calendar/corba-cal.c
parenta3b357a50150609a52ffc327c9355fceecab0b8a (diff)
downloadgsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar.gz
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar.bz2
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar.lz
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar.xz
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.tar.zst
gsoc2013-evolution-36e5e42d31a56499b1b2534fdf9f6a720b3813e0.zip
Added an argument to the corba get_number_of_objects, so you can decide
which status the objects you count should have, eg. any or modified etc. Will add record type someday. svn path=/trunk/; revision=1535
Diffstat (limited to 'calendar/corba-cal.c')
-rw-r--r--calendar/corba-cal.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/calendar/corba-cal.c b/calendar/corba-cal.c
index 2a3a727869..74afc0e76a 100644
--- a/calendar/corba-cal.c
+++ b/calendar/corba-cal.c
@@ -212,10 +212,40 @@ cal_repo_get_objects (PortableServer_Servant servant,
static CORBA_long
cal_repo_get_number_of_objects (PortableServer_Servant servant,
+ GNOME_Calendar_Repository_RecordStatus record_status,
CORBA_Environment *ev)
{
GnomeCalendar *gcal = gnomecal_from_servant (servant);
- return g_list_length(gcal->cal->events);
+ CORBA_long res;
+ GList *l;
+ iCalPilotState real_record_status;
+
+ if (record_status == GNOME_Calendar_Repository_ANY) {
+ return g_list_length(gcal->cal->events);
+ }
+
+ switch (record_status) {
+ case GNOME_Calendar_Repository_NEW:
+ real_record_status = ICAL_PILOT_SYNC_MOD;
+ break;
+ case GNOME_Calendar_Repository_MODIFIED:
+ real_record_status = ICAL_PILOT_SYNC_MOD;
+ break;
+ case GNOME_Calendar_Repository_DELETED:
+ real_record_status = ICAL_PILOT_SYNC_DEL;
+ break;
+ }
+
+ res = 0;
+
+ for (l = gcal->cal->events; l; l = l->next){
+ iCalObject *obj = l->data;
+
+ if (obj->pilot_status == real_record_status)
+ res ++;
+ }
+
+ return res;
}
static GNOME_Calendar_Repository_String_Sequence*