[evolution-data-server] alarm-notify: Use localized summary/description properties, if available
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] alarm-notify: Use localized summary/description properties, if available
- Date: Wed, 15 Jun 2022 10:17:41 +0000 (UTC)
commit 40fe702be31bd651732aa969cd3a7bce50717110
Author: Milan Crha <mcrha redhat com>
Date: Wed Jun 15 12:14:29 2022 +0200
alarm-notify: Use localized summary/description properties, if available
This shows localized summary/description in the locale the user
has set, if such is available in the iCalendar component.
Related to https://gitlab.gnome.org/GNOME/evolution/-/issues/876
src/calendar/libecal/e-reminder-watcher.c | 2 +-
src/libedataserverui/e-reminders-widget.c | 8 ++++++--
2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/src/calendar/libecal/e-reminder-watcher.c b/src/calendar/libecal/e-reminder-watcher.c
index a24ede2bc..8a14ecc84 100644
--- a/src/calendar/libecal/e-reminder-watcher.c
+++ b/src/calendar/libecal/e-reminder-watcher.c
@@ -2686,7 +2686,7 @@ e_reminder_watcher_get_alarm_summary (EReminderWatcher *watcher,
alarm_text = NULL;
- summary_text = e_cal_component_get_summary (rd->component);
+ summary_text = e_cal_component_dup_summary_for_locale (rd->component, NULL);
if (summary_text) {
const gchar *value;
diff --git a/src/libedataserverui/e-reminders-widget.c b/src/libedataserverui/e-reminders-widget.c
index d18474dac..9dc5c4846 100644
--- a/src/libedataserverui/e-reminders-widget.c
+++ b/src/libedataserverui/e-reminders-widget.c
@@ -1035,13 +1035,15 @@ reminders_widget_update_content (ERemindersWidget *reminders,
if (comp) {
ICalComponent *icomp;
+ ICalProperty *prop;
icomp = e_cal_component_get_icalcomponent (comp);
+ prop = icomp ? e_cal_util_component_find_property_for_locale
(icomp, I_CAL_DESCRIPTION_PROPERTY, NULL) : NULL;
- if (icomp) {
+ if (prop) {
const gchar *icomp_description;
- icomp_description = i_cal_component_get_description
(icomp);
+ icomp_description = i_cal_property_get_description
(prop);
if (icomp_description && *icomp_description) {
gchar *tmp;
@@ -1052,6 +1054,8 @@ reminders_widget_update_content (ERemindersWidget *reminders,
g_free (tmp);
}
+
+ g_clear_object (&prop);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]