[evolution] Bug 790069 - Free/Busy Publishing should not include X-SUMMARY and X-LOCATION
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug 790069 - Free/Busy Publishing should not include X-SUMMARY and X-LOCATION
- Date: Tue, 21 Nov 2017 16:31:22 +0000 (UTC)
commit 70892e03035579cf99deadba50e249929498c320
Author: Milan Crha <mcrha redhat com>
Date: Tue Nov 21 17:28:45 2017 +0100
Bug 790069 - Free/Busy Publishing should not include X-SUMMARY and X-LOCATION
src/plugins/publish-calendar/publish-calendar.c | 1 +
src/plugins/publish-calendar/publish-calendar.ui | 3 +++
src/plugins/publish-calendar/publish-format-fb.c | 19 ++++++++++++++++++-
src/plugins/publish-calendar/publish-location.h | 3 ++-
src/plugins/publish-calendar/url-editor-dialog.c | 10 +++++-----
5 files changed, 29 insertions(+), 7 deletions(-)
---
diff --git a/src/plugins/publish-calendar/publish-calendar.c b/src/plugins/publish-calendar/publish-calendar.c
index 6f22709..032be4c 100644
--- a/src/plugins/publish-calendar/publish-calendar.c
+++ b/src/plugins/publish-calendar/publish-calendar.c
@@ -224,6 +224,7 @@ publish_online (EPublishUri *uri,
publish_calendar_as_ical (stream, uri, &error);
break;
case URI_PUBLISH_AS_FB:
+ case URI_PUBLISH_AS_FB_WITH_DETAILS:
publish_calendar_as_fb (stream, uri, &error);
break;
}
diff --git a/src/plugins/publish-calendar/publish-calendar.ui
b/src/plugins/publish-calendar/publish-calendar.ui
index 7d7a68e..cb36135 100644
--- a/src/plugins/publish-calendar/publish-calendar.ui
+++ b/src/plugins/publish-calendar/publish-calendar.ui
@@ -21,6 +21,9 @@
<row>
<col id="0" translatable="yes">Free/Busy</col>
</row>
+ <row>
+ <col id="0" translatable="yes">Free/Busy with Details</col>
+ </row>
</data>
</object>
<object class="GtkListStore" id="model2">
diff --git a/src/plugins/publish-calendar/publish-format-fb.c
b/src/plugins/publish-calendar/publish-format-fb.c
index 284fc98..2640e92 100644
--- a/src/plugins/publish-calendar/publish-format-fb.c
+++ b/src/plugins/publish-calendar/publish-format-fb.c
@@ -32,6 +32,7 @@
static gboolean
write_calendar (const gchar *uid,
GOutputStream *stream,
+ gboolean with_details,
gint dur_type,
gint dur_value,
GError **error)
@@ -102,6 +103,21 @@ write_calendar (const gchar *uid,
for (iter = objects; iter; iter = iter->next) {
ECalComponent *comp = iter->data;
icalcomponent *icalcomp = icalcomponent_new_clone (e_cal_component_get_icalcomponent
(comp));
+
+ if (!icalcomp)
+ continue;
+
+ if (!with_details) {
+ icalproperty *prop;
+
+ for (prop = icalcomponent_get_first_property (icalcomp,
ICAL_FREEBUSY_PROPERTY);
+ prop;
+ prop = icalcomponent_get_next_property (icalcomp,
ICAL_FREEBUSY_PROPERTY)) {
+ icalproperty_remove_parameter_by_name (prop, "X-SUMMARY");
+ icalproperty_remove_parameter_by_name (prop, "X-LOCATION");
+ }
+ }
+
icalcomponent_add_component (top_level, icalcomp);
}
@@ -132,12 +148,13 @@ publish_calendar_as_fb (GOutputStream *stream,
GError **error)
{
GSList *l;
+ gboolean with_details = uri->publish_format == URI_PUBLISH_AS_FB_WITH_DETAILS;
/* events */
l = uri->events;
while (l) {
gchar *uid = l->data;
- if (!write_calendar (uid, stream, uri->fb_duration_type, uri->fb_duration_value, error))
+ if (!write_calendar (uid, stream, with_details, uri->fb_duration_type,
uri->fb_duration_value, error))
break;
l = g_slist_next (l);
}
diff --git a/src/plugins/publish-calendar/publish-location.h b/src/plugins/publish-calendar/publish-location.h
index 3a3af17..67d7eaa 100644
--- a/src/plugins/publish-calendar/publish-location.h
+++ b/src/plugins/publish-calendar/publish-location.h
@@ -38,7 +38,8 @@ enum publish_frequency {
enum publish_format {
URI_PUBLISH_AS_ICAL,
- URI_PUBLISH_AS_FB
+ URI_PUBLISH_AS_FB,
+ URI_PUBLISH_AS_FB_WITH_DETAILS
};
enum FBDurationType {
diff --git a/src/plugins/publish-calendar/url-editor-dialog.c
b/src/plugins/publish-calendar/url-editor-dialog.c
index 2415806..c202a5e 100644
--- a/src/plugins/publish-calendar/url-editor-dialog.c
+++ b/src/plugins/publish-calendar/url-editor-dialog.c
@@ -115,14 +115,14 @@ check_input (UrlEditorDialog *dialog)
uri = dialog->uri;
- if (gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->type_selector)) == 1) {
- gtk_widget_show (dialog->fb_duration_label);
- gtk_widget_show (dialog->fb_duration_spin);
- gtk_widget_show (dialog->fb_duration_combo);
- } else {
+ if (gtk_combo_box_get_active (GTK_COMBO_BOX (dialog->type_selector)) == URI_PUBLISH_AS_ICAL) {
gtk_widget_hide (dialog->fb_duration_label);
gtk_widget_hide (dialog->fb_duration_spin);
gtk_widget_hide (dialog->fb_duration_combo);
+ } else {
+ gtk_widget_show (dialog->fb_duration_label);
+ gtk_widget_show (dialog->fb_duration_spin);
+ gtk_widget_show (dialog->fb_duration_combo);
}
if (gtk_widget_get_sensitive (dialog->events_selector)) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]