aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-09-06 09:06:48 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-09-06 09:06:48 +0800
commit114f5b7f916184cf8269b36a06b74b74bb7b18e2 (patch)
treeeb0fe5dcdda6dae6727c5f616e3e418cd6c9d65f
parente8648e48175c1b6d26bff5316c2c7d738245a63c (diff)
downloadgsoc2013-evolution-114f5b7f916184cf8269b36a06b74b74bb7b18e2.tar.gz
gsoc2013-evolution-114f5b7f916184cf8269b36a06b74b74bb7b18e2.tar.zst
gsoc2013-evolution-114f5b7f916184cf8269b36a06b74b74bb7b18e2.zip
Kill all exdates if there are no dates in the box
2000-09-05 JP Rosevear <jpr@helixcode.com> * gui/event-editor.c (dialog_to_comp_object): Kill all exdates if there are no dates in the box * cal-util/cal-recur.c (generate_instances_for_year): Add a special case for when there are exceptions but no rrules or rdates. (cal_obj_remove_exceptions): Use date only compare func (cal_obj_date_only_compare_func): New compare function that compares the date only, not the time. * gui/event-editor.c (dialog_to_comp_object): Need a break for the yearly recurrence type (dialog_to_comp_object): We need to allocate icaltimetypes for the exdate list (fill_widgets): Handle a weekly recurrence with no particular day set (dialog_to_comp_object): Kill all rrules if "None" is selected as the recurrence type by the user svn path=/trunk/; revision=5218
-rw-r--r--calendar/ChangeLog19
-rw-r--r--calendar/cal-util/cal-recur.c40
-rw-r--r--calendar/gui/event-editor.c23
3 files changed, 72 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index af7e292b09..05574bd69d 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,22 @@
+2000-09-05 JP Rosevear <jpr@helixcode.com>
+
+ * gui/event-editor.c (dialog_to_comp_object): Kill all exdates if
+ there are no dates in the box
+
+ * cal-util/cal-recur.c (generate_instances_for_year): Add a special
+ case for when there are exceptions but no rrules or rdates.
+ (cal_obj_remove_exceptions): Use date only compare func
+ (cal_obj_date_only_compare_func): New compare function that
+ compares the date only, not the time.
+
+ * gui/event-editor.c (dialog_to_comp_object): Need a break for the
+ yearly recurrence type
+ (dialog_to_comp_object): We need to allocate icaltimetypes for the
+ exdate list
+ (fill_widgets): Handle a weekly recurrence with no particular day set
+ (dialog_to_comp_object): Kill all rrules if "None" is selected as
+ the recurrence type by the user
+
2000-09-06 Damon Chaplin <damon@helixcode.com>
* gui/e-calendar-table.c (e_calendar_table_open_task): uses the new
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index fd4d875d83..49bf9a9a08 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -792,6 +792,18 @@ generate_instances_for_year (CalComponent *comp,
g_array_append_val (occs, cotime);
}
+ /* Special case when there are exceptions but no recurrence rules */
+ if (occs->len == 0) {
+ CalComponentDateTime dt;
+ time_t t;
+
+ cal_component_get_dtstart (comp, &dt);
+ t = icaltime_as_timet (*dt.value);
+ cal_object_time_from_time (&cotime, t);
+
+ g_array_append_val (occs, cotime);
+ }
+
/* Expand each of the exception rules. */
for (elem = exrules; elem; elem = elem->next) {
struct icalrecurrencetype *ir;
@@ -1392,7 +1404,7 @@ cal_obj_remove_exceptions (GArray *occs,
/* Step through the exceptions until we come to one
that matches or follows this occurrence. */
while (ex_occ) {
- cmp = cal_obj_time_compare_func (ex_occ, occ);
+ cmp = cal_obj_date_only_compare_func (ex_occ, occ);
if (cmp > 0)
break;
@@ -2952,6 +2964,32 @@ cal_obj_time_compare_func (const void *arg1,
return 0;
}
+static gint
+cal_obj_date_only_compare_func (const void *arg1,
+ const void *arg2)
+{
+ CalObjTime *cotime1, *cotime2;
+
+ cotime1 = (CalObjTime*) arg1;
+ cotime2 = (CalObjTime*) arg2;
+
+ if (cotime1->year < cotime2->year)
+ return -1;
+ if (cotime1->year > cotime2->year)
+ return 1;
+
+ if (cotime1->month < cotime2->month)
+ return -1;
+ if (cotime1->month > cotime2->month)
+ return 1;
+
+ if (cotime1->day < cotime2->day)
+ return -1;
+ if (cotime1->day > cotime2->day)
+ return 1;
+
+ return 0;
+}
/* Returns the weekday of the given CalObjTime, from 0 - 6. The week start
day is Monday by default, but can be set in the recurrence rule. */
diff --git a/calendar/gui/event-editor.c b/calendar/gui/event-editor.c
index 9a398d13cb..d1742b280a 100644
--- a/calendar/gui/event-editor.c
+++ b/calendar/gui/event-editor.c
@@ -802,8 +802,8 @@ fill_widgets (EventEditor *ee)
case ICAL_SATURDAY_WEEKDAY:
e_dialog_toggle_set (priv->recurrence_rule_weekly_sat, TRUE);
break;
- default:
- g_assert_not_reached ();
+ case ICAL_NO_WEEKDAY:
+ break;
}
}
break;
@@ -1021,7 +1021,8 @@ dialog_to_comp_object (EventEditor *ee)
case ICAL_YEARLY_RECURRENCE:
recur.interval = e_dialog_spin_get_int (priv->recurrence_rule_yearly_every_n_years);
-
+ break;
+
default:
g_assert_not_reached ();
}
@@ -1047,24 +1048,28 @@ dialog_to_comp_object (EventEditor *ee)
list = NULL;
list = g_slist_append (list, &recur);
cal_component_set_rrule_list (comp, list);
+ g_slist_free (list);
+ } else {
+ list = NULL;
+ cal_component_set_rrule_list (comp, list);
}
/* Set exceptions */
list = NULL;
exception_list = GTK_CLIST (priv->recurrence_exceptions_list);
for (i = 0; i < exception_list->rows; i++) {
- struct icaltimetype tt;
+ struct icaltimetype *tt;
time_t *t;
t = gtk_clist_get_row_data (exception_list, i);
- tt = icaltime_from_timet (*t, FALSE, TRUE);
+ tt = g_new0 (struct icaltimetype, 1);
+ *tt = icaltime_from_timet (*t, FALSE, FALSE);
- list = g_slist_prepend (list, &tt);
+ list = g_slist_prepend (list, tt);
}
- if (list) {
- cal_component_set_exdate_list (comp, list);
+ cal_component_set_exdate_list (comp, list);
+ if (list)
cal_component_free_exdate_list (list);
- }
cal_component_commit_sequence (comp);
}
6446 * *** empty log message ***Wang Jian2003-08-072-3430/+2505 * Fix a bug (control characters accidentally inserted into the file?) and aDan Winship2003-08-062-3/+8 * Updated italian translation (final revision done).Marco Ciampa2003-08-052-70/+63 * Updated italian traslationMarco Ciampa2003-08-052-117/+103 * Updated italian translation.Marco Ciampa2003-08-041-130/+111 * Updated italian traslation (under revision 35% done)Marco Ciampa2003-08-042-109/+97 * retryingSajith VK2003-08-021-0/+27397 * Updated French translation.Christophe Merlet2003-08-022-2875/+2966 * Updated italian translation (under revision 25% completed)Marco Ciampa2003-08-022-183/+155 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-08-012-492/+528 * Updated Serbian translation by Serbian team (Prevod.org).Danilo Šegan2003-07-264-1677/+1842 * Updated italian translation.Marco Ciampa2003-07-262-105/+7 * Updated German translation.Christian Neumair2003-07-232-1521/+976 * Added initial Malay Translation by MIMOS Open Source Development GroupHasbullah Bin Pit2003-07-213-1/+27695 * Convert unmaintained translations to UTF-8Kwok-Koon Cheung2003-07-195-13661/+14078 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-07-102-2/+7 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-07-072-268/+227 * Updated the Greek translationKostas Papadimas2003-06-272-1323/+1444 * 1.4.1 release.Ettore Perazzoli2003-06-2642-19513/+20025 * Updated Macedonian translationIvan Stojmirov2003-06-251-2/+0 * Updated Macedonian translationIvan Stojmirov2003-06-251-1/+0 * Updated Macedonian translationIvan Stojmirov2003-06-252-5/+11 * ko.po updatedKang Jeong-Hee2003-06-252-4080/+3635 * Update Czech translationMiloslav Trmac2003-06-242-115/+125 * UpdatedFatih Demir2003-06-242-263/+200 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-06-242-66/+77 * Updated italian translation.Marco Ciampa2003-06-242-5/+8 * Updated the Greek translationKostas Papadimas2003-06-222-1192/+566 * Updated Serbian translation by Serbian team (Prevod.org).Danilo Šegan2003-06-223-5785/+5572 * Dutch translation updated.Vincent van Adrighem2003-06-212-1/+5 * Dutch translation updated.Vincent van Adrighem2003-06-212-114/+124 * Updated Swedish translation.Christian Rose2003-06-212-12/+21 * Proofreading: 100%Andras Timar2003-06-202-92/+125 * Updated Swedish translation.Christian Rose2003-06-202-432/+441 * Added "sr" and "sr@Latn" to ALL_LINGUAS.Danilo Šegan2003-06-203-0/+56091 * Translation: 100% reached, Proofreading: 37%Andras Timar2003-06-192-214/+237 * *** empty log message ***Wang Jian2003-06-192-386/+388 * Updated italian translation.Marco Ciampa2003-06-192-220/+223 * Updated Brazilian Portuguese translation done by Gustavo Maciel DiasGustavo Maciel Dias Vieira2003-06-192-383/+392 * Updated italian translation.Marco Ciampa2003-06-192-25/+31 * Updated tr.poFatih Demir2003-06-192-72/+60 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-06-192-368/+377 * Updated Hungarian translation.Andras Timar2003-06-182-383/+283 * added Macedonian translationIvan Stojmirov2003-06-181-0/+28229 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-06-182-110/+112 * Updated tr.po by GorkemFatih Demir2003-06-162-671/+521 * Updated Hungarian translation.Andras Timar2003-06-162-741/+584 * Dutch translation updated.Vincent van Adrighem2003-06-152-355/+353 * Update Czech translation, minor fixesMiloslav Trmac2003-06-152-363/+366 * fixes a typo in german translationSven Herzberg2003-06-131-3/+3 * Updated Brazilian Portuguese translation done by Gustavo Maciel DiasGustavo Maciel Dias Vieira2003-06-112-148/+70 * Roll over ChangeLogs.Ettore Perazzoli2003-06-102-4727/+4726 * Updated Spanish translation from Francisco Javier FernandezPablo Gonzalo del Campo2003-06-092-134/+99 * Just a space missing.Marco Ciampa2003-06-091-7/+7 * Fix some bugs in Czech translationMiloslav Trmac2003-06-042-62/+64 * Updated (from Wang Li <charles@linux.net.cn> and FundaEttore Perazzoli2003-06-042-22847/+2545 * Updated italian translation.Marco Ciampa2003-06-042-169/+89 * fixed quotesStanislav Brabec2003-06-032-2/+6 * 1.4.0!Ettore Perazzoli2003-06-0340-12602/+12643 * Dutch translation updated.Vincent van Adrighem2003-06-022-283/+287 * Dutch translation updated.Vincent van Adrighem2003-05-302-544/+456 * ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>.Dmitry Mastrukov2003-05-302-254/+180 * Dutch translation updated.Vincent van Adrighem2003-05-302-292/+255 * Dutch translation updated.Vincent van Adrighem2003-05-282-147/+64 * be.po: Updated Belarusian translation from Belarusian team <i18n@mova.org>.Dmitry Mastrukov2003-05-272-2314/+1526 * Updated Spanish translation by Francisco Javier F. SerradorPablo Gonzalo del Campo2003-05-272-95/+56 * Dutch translation updated.Vincent van Adrighem2003-05-262-3/+7 * Sync 1.3.92.Ettore Perazzoli2003-05-2340-6844/+25732 * Update translation.Kjartan Maraas2003-05-222-128/+43 * be.po: Added Belarusian translation from Belarusian team <i18n@mova.org>.Dmitry Mastrukov2003-05-222-0/+10860 * Updated Portuguese translation.Duarte Loreto2003-05-222-66/+39 * 1.3.91.Ettore Perazzoli2003-05-2239-33495/+35533 * Updated Swedish translation.Christian Rose2003-05-212-227/+240 * Update Czech translationMiloslav Trmac2003-05-212-217/+218 * Update Czech translationMiloslav Trmac2003-05-202-218/+199 * Updated by Francisco Javier Fernandez <serrador@arrakis.es>Pablo Gonzalo del Campo2003-05-202-662/+658 * Updated Swedish translation.Christian Rose2003-05-202-610/+716 * ru.po: Updated Russian translation from Russian team <gnome-cyr@gnome.org>.Dmitry Mastrukov2003-05-192-2248/+683 * Update Czech translationMiloslav Trmac2003-05-172-609/+618 * Updated Brazilian Portuguese translation done by Gustavo Maciel DiasGustavo Maciel Dias Vieira2003-05-172-983/+720 * Fix the last part of #113003.Anders Carlsson2003-05-152-3/+7 * Fix #113003 in bugzilla.gnome.org.Christian Rose2003-05-152-280/+272 * Updated a bit.Kenneth Rohde Christiansen2003-05-142-551/+434 * Updated by Francisco Javier Fernandez <serrador@arrakis.es>Carlos Perelló Marín2003-05-142-275/+250 * Updated Norwegian translation.Kjartan Maraas2003-05-132-1369/+1329 * Convert some po to UTF-8Kwok-Koon Cheung2003-05-127-5200/+5202 * Remove non-existant file(s).Abel Cheung2003-05-122-7/+4 * Updated Portuguese translation.Duarte Loreto2003-05-082-155/+141 * Updated French translation.Christophe Fergeau2003-05-072-550/+430 * Updated Italian translation.Marco Ciampa2003-05-062-284/+216 * Updated German translation.Christian Neumair2003-05-062-192/+156 * UpdateTakuro Kitame2003-05-011-217/+118 * Updated Japanese translation.Takuro Kitame2003-05-011-0/+4 * 1.3.3.Ettore Perazzoli2003-04-3039-27502/+31612 * Update Czech translationMiloslav Trmac2003-04-302-634/+131 * Updated Swedish translation.Christian Rose2003-04-292-105/+114 * Update Cezech translationMiloslav Trmac2003-04-282-242/+294 * Updated portuguese translation.Duarte Loreto2003-04-272-310/+364 * Updated Swedish translation.Christian Rose2003-04-272-30/+82 * Updated Norwegian translation. Added calendar/gui/dialogs/delete-error.cKjartan Maraas2003-04-263-5706/+864 * Updated Spanish translation by Francisco Javier FernandezPablo Gonzalo del Campo2003-04-262-342/+366 * Updated Swedish translation.Christian Rose2003-04-252-444/+473 * Dutch translation updated.Vincent van Adrighem2003-04-252-631/+438 * Updated Czech translationMiloslav Trmac2003-04-242-117/+120 * Updated italian traslation.Marco Ciampa2003-04-242-945/+1046 * Updated Spanish translation by Francisco Javier FernandezPablo Gonzalo del Campo2003-04-242-710/+687 * Dutch translation updated.Vincent van Adrighem2003-04-232-139/+155 * Update Czech translationMiloslav Trmac2003-04-232-96/+112 * Updated Italian translation.Marco Ciampa2003-04-232-863/+127 * Dutch translation updated.Vincent van Adrighem2003-04-232-2561/+653 * Updated Portuguese translation.Duarte Loreto2003-04-232-152/+168 * Update Czech translationMiloslav Trmac2003-04-222-85/+71 * Updated Portuguese translation.Duarte Loreto2003-04-182-459/+486 * Update Czech translationMiloslav Trmac2003-04-172-431/+422 * Removed erroneous line. Thanks to Christian Rose who reported that issue.Christian Neumair2003-04-173-2/+6 * Updated Swedish translation.Christian Rose2003-04-172-557/+556 * Updated German translation.Christian Neumair2003-04-171-62/+63 * Updated German translation and POTFILES.skip.Christian Neumair2003-04-163-259/+270 * Fixed an erroneous translation for "message".Wang Jian2003-04-152-2/+6 * Updated Spanish translation by Francisco Javier FernandezPablo Gonzalo del Campo2003-04-152-298/+267 * Updated Portuguese translation.Duarte Loreto2003-04-142-112/+70 * Update Czech translationMiloslav Trmac2003-04-122-67/+59 * Updated German translation, added missing files to POTFILES.*.Christian Neumair2003-04-124-309/+351 * The return of 1.3.2.Ettore Perazzoli2003-04-12