aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-task-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-task-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-task-shell-sidebar.c')
-rw-r--r--modules/calendar/e-task-shell-sidebar.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 1653fe287b..d88d5e7028 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -237,10 +237,11 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
{
ECalClient *client = E_CAL_CLIENT (source_object);
ETaskShellSidebar *task_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 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
shell_sidebar = E_SHELL_SIDEBAR (task_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 @@ task_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-tasks",
- NULL);
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source), NULL);
/* fall through */
default:
@@ -300,6 +305,8 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
+ e_source_get_display_name (parent),
+ e_source_get_display_name (source),
error->message, NULL);
}
@@ -307,10 +314,12 @@ task_shell_sidebar_client_opened_cb (GObject *source_object,
task_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 @@ task_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-tasks",
+ 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;
}