[evolution-mapi] Bug 795870 - Add a way to initiate refresh of account sources



commit 4767237c265f1b00cfefd1ddb85b536042a819df
Author: Milan Crha <mcrha redhat com>
Date:   Fri Jun 8 10:46:47 2018 +0200

    Bug 795870 - Add a way to initiate refresh of account sources
    
    This is to hide menu options when the account node is right-clicked.

 src/configuration/e-mapi-config-utils.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/src/configuration/e-mapi-config-utils.c b/src/configuration/e-mapi-config-utils.c
index 342b571..37d390d 100644
--- a/src/configuration/e-mapi-config-utils.c
+++ b/src/configuration/e-mapi-config-utils.c
@@ -954,6 +954,7 @@ update_mapi_source_entries_cb (EShellView *shell_view,
        GtkActionGroup *action_group;
        EShell *shell;
        EShellWindow *shell_window;
+       ESource *source = NULL;
        const gchar *group;
        gboolean is_mapi_source, is_online;
 
@@ -971,7 +972,21 @@ update_mapi_source_entries_cb (EShellView *shell_view,
        else
                g_return_if_reached ();
 
-       is_mapi_source = get_selected_mapi_source (shell_view, NULL, NULL);
+       is_mapi_source = get_selected_mapi_source (shell_view, &source, NULL);
+
+       if (is_mapi_source) {
+               ESource *clicked_source = NULL;
+
+               g_object_get (G_OBJECT (shell_view), "clicked-source", &clicked_source, NULL);
+
+               if (clicked_source && clicked_source != source)
+                       is_mapi_source = FALSE;
+
+               g_clear_object (&clicked_source);
+       }
+
+       g_clear_object (&source);
+
        shell_window = e_shell_view_get_shell_window (shell_view);
        shell = e_shell_window_get_shell (shell_window);
 


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