diff options
Diffstat (limited to 'modules/calendar/e-memo-shell-sidebar.c')
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index f7cbea9183..f59e0a8605 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -57,6 +57,8 @@ struct _EMemoShellSidebarPrivate { * which is bound by an EBinding to ECalModel. */ ECalClient *default_client; + ESource *loading_default_source_instance; /* not-reffed, only for comparison */ + GCancellable *loading_default_client; GCancellable *loading_clients; }; @@ -363,6 +365,14 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object, e_client_utils_open_new_finish (source, result, &client, &error); + if (priv->loading_default_client) { + g_object_unref (priv->loading_default_client); + priv->loading_default_client = NULL; + } + + if (source == priv->loading_default_source_instance) + priv->loading_default_source_instance = NULL; + /* Ignore cancellations. */ if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { @@ -407,6 +417,10 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar, priv = memo_shell_sidebar->priv; + /* already loading that source as default source */ + if (source == priv->loading_default_source_instance) + return; + /* FIXME Sidebar should not be accessing the EShellContent. * This probably needs to be moved to EMemoShellView. */ shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); @@ -431,6 +445,8 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar, return; } + /* it's only for pointer comparison, no need to ref it */ + priv->loading_default_source_instance = source; priv->loading_default_client = g_cancellable_new (); e_client_utils_open_new ( |