[evolution] I#180 - [ECompEditor] Organizer changed when editing existing component



commit 0e4952ca89ba980e6e6f2388a0669f41cc6c7e0e
Author: Milan Crha <mcrha redhat com>
Date:   Thu Oct 25 10:08:58 2018 +0200

    I#180 - [ECompEditor] Organizer changed when editing existing component
    
    Closes https://gitlab.gnome.org/GNOME/evolution/issues/180

 src/calendar/gui/e-comp-editor-page-general.c | 12 ++++++++----
 src/calendar/gui/e-comp-editor.c              |  4 ++--
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/calendar/gui/e-comp-editor-page-general.c b/src/calendar/gui/e-comp-editor-page-general.c
index e2d48d90c4..11dee5ade3 100644
--- a/src/calendar/gui/e-comp-editor-page-general.c
+++ b/src/calendar/gui/e-comp-editor-page-general.c
@@ -494,13 +494,17 @@ ecep_general_target_client_notify_cb (ECompEditor *comp_editor,
                                      GParamSpec *param,
                                      ECompEditorPageGeneral *page_general)
 {
-       const gchar *cal_email_address;
-
        g_return_if_fail (E_IS_COMP_EDITOR (comp_editor));
        g_return_if_fail (E_IS_COMP_EDITOR_PAGE_GENERAL (page_general));
 
-       cal_email_address = e_comp_editor_get_cal_email_address (comp_editor);
-       ecep_general_pick_organizer_for_email_address (page_general, cal_email_address);
+       if ((e_comp_editor_get_flags (comp_editor) & E_COMP_EDITOR_FLAG_IS_NEW) != 0 ||
+           (e_comp_editor_get_source_client (comp_editor) != NULL &&
+            e_comp_editor_get_target_client (comp_editor) != e_comp_editor_get_source_client (comp_editor))) 
{
+               const gchar *cal_email_address;
+
+               cal_email_address = e_comp_editor_get_cal_email_address (comp_editor);
+               ecep_general_pick_organizer_for_email_address (page_general, cal_email_address);
+       }
 
        if (page_general->priv->comp_color) {
                ECalClient *target_client;
diff --git a/src/calendar/gui/e-comp-editor.c b/src/calendar/gui/e-comp-editor.c
index e5a247e52d..f2309f904a 100644
--- a/src/calendar/gui/e-comp-editor.c
+++ b/src/calendar/gui/e-comp-editor.c
@@ -2943,13 +2943,13 @@ e_comp_editor_set_target_client (ECompEditor *comp_editor,
        g_clear_object (&comp_editor->priv->target_client);
        comp_editor->priv->target_client = client;
 
-       g_object_notify (G_OBJECT (comp_editor), "target-client");
-
        if (client && !comp_editor->priv->source_client && comp_editor->priv->origin_source &&
            e_source_equal (e_client_get_source (E_CLIENT (client)), comp_editor->priv->origin_source))
                e_comp_editor_set_source_client (comp_editor, client);
 
        e_comp_editor_sensitize_widgets (comp_editor);
+
+       g_object_notify (G_OBJECT (comp_editor), "target-client");
 }
 
 const gchar *


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