[evolution] [Event/Task editor] Force timezone part show only if really needed



commit b565a124ed715010f8a63aa43374df769aa2ba7d
Author: Milan Crha <mcrha redhat com>
Date:   Fri Oct 19 10:01:57 2018 +0200

    [Event/Task editor] Force timezone part show only if really needed
    
    It could be that the two zones had been allocated differently, thus
    their pointer had been different, but they had been the same otherwise,
    with the same location and with the same TZID, in which case it is
    not needed to force the show of the timezone part in the editor.

 src/calendar/gui/e-comp-editor-event.c | 7 ++++++-
 src/calendar/gui/e-comp-editor-task.c  | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor-event.c b/src/calendar/gui/e-comp-editor-event.c
index fa9a69ad7c..698a6c1d88 100644
--- a/src/calendar/gui/e-comp-editor-event.c
+++ b/src/calendar/gui/e-comp-editor-event.c
@@ -326,12 +326,17 @@ ece_event_update_timezone (ECompEditorEvent *event_editor,
 
        if (zone) {
                GtkWidget *edit_widget;
+               icaltimezone *cfg_zone;
 
                edit_widget = e_comp_editor_property_part_get_edit_widget (event_editor->priv->timezone);
 
                e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (edit_widget), zone);
 
-               if (zone != calendar_config_get_icaltimezone ()) {
+               cfg_zone = calendar_config_get_icaltimezone ();
+
+               if (zone && cfg_zone && zone != cfg_zone &&
+                   (g_strcmp0 (icaltimezone_get_location (zone), icaltimezone_get_location (cfg_zone)) != 0 
||
+                    g_strcmp0 (icaltimezone_get_tzid (zone), icaltimezone_get_tzid (cfg_zone)) != 0)) {
                        /* Show timezone part */
                        GtkAction *action;
 
diff --git a/src/calendar/gui/e-comp-editor-task.c b/src/calendar/gui/e-comp-editor-task.c
index 54f7451c4e..ca05ad2885 100644
--- a/src/calendar/gui/e-comp-editor-task.c
+++ b/src/calendar/gui/e-comp-editor-task.c
@@ -135,12 +135,17 @@ ece_task_update_timezone (ECompEditorTask *task_editor,
 
        if (zone) {
                GtkWidget *edit_widget;
+               icaltimezone *cfg_zone;
 
                edit_widget = e_comp_editor_property_part_get_edit_widget (task_editor->priv->timezone);
 
                e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (edit_widget), zone);
 
-               if (zone != calendar_config_get_icaltimezone ()) {
+               cfg_zone = calendar_config_get_icaltimezone ();
+
+               if (zone && cfg_zone && zone != cfg_zone &&
+                   (g_strcmp0 (icaltimezone_get_location (zone), icaltimezone_get_location (cfg_zone)) != 0 
||
+                    g_strcmp0 (icaltimezone_get_tzid (zone), icaltimezone_get_tzid (cfg_zone)) != 0)) {
                        /* Show timezone part */
                        GtkAction *action;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]