[california] Don't crash when updating recurring event: Bug #737235
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [california] Don't crash when updating recurring event: Bug #737235
- Date: Wed, 24 Sep 2014 20:45:58 +0000 (UTC)
commit 353e96d6201b4eb08ad0dd9b76a35a07f52d6c9b
Author: Jim Nelson <jim yorba org>
Date: Wed Sep 24 13:45:18 2014 -0700
Don't crash when updating recurring event: Bug #737235
Property notification can cause make_rrule() from being called before
widgets are properly configured to reflect RRULE.
src/host/host-create-update-recurring.vala | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
---
diff --git a/src/host/host-create-update-recurring.vala b/src/host/host-create-update-recurring.vala
index ad49c4a..86ab149 100644
--- a/src/host/host-create-update-recurring.vala
+++ b/src/host/host-create-update-recurring.vala
@@ -410,7 +410,7 @@ public class CreateUpdateRecurring : Gtk.Grid, Toolkit.Card {
[GtkCallback]
private void on_update_explanation() {
- update_explanation(make_recurring_checkbutton.active ? make_rrule() : null, start_date);
+ update_explanation(can_make_rrule() ? make_rrule() : null, start_date);
}
[GtkCallback]
@@ -491,6 +491,23 @@ public class CreateUpdateRecurring : Gtk.Grid, Toolkit.Card {
jump_to_card_by_name(CreateUpdateEvent.ID, event);
}
+ private bool can_make_rrule() {
+ if (!make_recurring_checkbutton.active)
+ return false;
+
+ switch (repeats_combobox.active) {
+ case Repeats.DAILY:
+ case Repeats.WEEKLY:
+ case Repeats.DAY_OF_THE_WEEK:
+ case Repeats.DAY_OF_THE_MONTH:
+ case Repeats.YEARLY:
+ return true;
+
+ default:
+ return false;
+ }
+ }
+
private Component.RecurrenceRule make_rrule() {
iCal.icalrecurrencetype_frequency freq;
switch (repeats_combobox.active) {
@@ -593,7 +610,7 @@ public class CreateUpdateRecurring : Gtk.Grid, Toolkit.Card {
master.exdates = null;
master.rdates = null;
- if (!make_recurring_checkbutton.active)
+ if (!can_make_rrule())
master.make_recurring(null);
else
master.make_recurring(make_rrule());
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]