[evolution] I#1791 - itip-view: Incorrect calendar used in certain corner case



commit 04a326cec96a1c79854cf7dec80fe7e38c3b69c9
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 31 15:44:31 2022 +0100

    I#1791 - itip-view: Incorrect calendar used in certain corner case
    
    Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1791

 data/webkit/e-web-view.js              |  4 ++++
 src/modules/itip-formatter/itip-view.c | 10 +++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/data/webkit/e-web-view.js b/data/webkit/e-web-view.js
index 73fce72680..c01707b070 100644
--- a/data/webkit/e-web-view.js
+++ b/data/webkit/e-web-view.js
@@ -1557,6 +1557,10 @@ EvoItip.SetSelectSelected = function(iframe_id, element_id, option_value)
                                break;
                        }
                }
+
+               // claim what source is selected when failed to select the requested source
+               if (ii >= elem.length)
+                       EvoItip.selectedSourceChanged(elem);
        }
 }
 
diff --git a/src/modules/itip-formatter/itip-view.c b/src/modules/itip-formatter/itip-view.c
index 8344ac0040..f4f4ec7385 100644
--- a/src/modules/itip-formatter/itip-view.c
+++ b/src/modules/itip-formatter/itip-view.c
@@ -3026,15 +3026,19 @@ itip_view_set_source (ItipView *view,
                view->priv->part_id, SELECT_ESOURCE, FALSE,
                e_web_view_get_cancellable (web_view));
 
+       /* Set the source UID before updating the combo, to be able
+          to change the source when the passed-in source is not
+          available in the combo. */
+       itip_set_selected_source_uid (view, e_source_get_uid (source));
+
+       source_changed_cb (view);
+
        e_web_view_jsc_run_script (WEBKIT_WEB_VIEW (web_view), e_web_view_get_cancellable (web_view),
                "EvoItip.SetSelectSelected(%s, %s, %s);",
                view->priv->part_id,
                SELECT_ESOURCE,
                e_source_get_uid (source));
 
-       itip_set_selected_source_uid (view, e_source_get_uid (source));
-
-       source_changed_cb (view);
        g_object_unref (web_view);
 }
 


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