aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-memo-shell-sidebar.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-11-27 20:11:18 +0800
committerMilan Crha <mcrha@redhat.com>2012-11-27 20:11:18 +0800
commit4c699e7e03975639db4a0aa1eddb935e79702248 (patch)
treed433ae6c64223925fd337d9c6fa3e026124f011a /modules/calendar/e-memo-shell-sidebar.c
parenta2f69b1d463f87e6de3c30db9043533ef37564d2 (diff)
downloadgsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.gz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.bz2
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.lz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.xz
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.tar.zst
gsoc2013-evolution-4c699e7e03975639db4a0aa1eddb935e79702248.zip
Identify calendar/memo/task sources in error messages
Diffstat (limited to 'modules/calendar/e-memo-shell-sidebar.c')
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index f59e0a8605..7d46384f82 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -237,10 +237,11 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
{
ECalClient *client = E_CAL_CLIENT (source_object);
EMemoShellSidebar *memo_shell_sidebar = user_data;
- ESource *source;
+ ESource *source, *parent;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ ESourceRegistry *registry;
GError *error = NULL;
source = e_client_get_source (E_CLIENT (client));
@@ -274,6 +275,8 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar);
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_content = e_shell_view_get_shell_content (shell_view);
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
/* Handle errors. */
switch ((error && error->domain == E_CLIENT_ERROR) ? error->code : -1) {
@@ -286,13 +289,15 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
G_STRFUNC, e_source_get_display_name (source),
error->message);
g_clear_error (&error);
+ g_object_unref (parent);
return;
case E_CLIENT_ERROR_REPOSITORY_OFFLINE:
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-memos",
- NULL);
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source), NULL);
/* fall through */
default:
@@ -300,6 +305,8 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
}
@@ -307,10 +314,12 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object,
memo_shell_sidebar,
e_client_get_source (E_CLIENT (client)));
g_clear_error (&error);
+ g_object_unref (parent);
return;
}
g_clear_error (&error);
+ g_object_unref (parent);
/* to have them ready for later use */
e_client_retrieve_capabilities (
@@ -381,12 +390,21 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object,
goto exit;
} else if (error != NULL) {
+ ESourceRegistry *registry;
+ ESource *parent;
+
+ registry = e_shell_get_registry (e_shell_backend_get_shell (e_shell_view_get_shell_backend (shell_view)));
+ parent = e_source_registry_ref_source (registry, e_source_get_parent (source));
+
g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
g_error_free (error);
+ g_object_unref (parent);
goto exit;
}