aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-23 22:13:04 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-23 22:35:20 +0800
commit2862c6fe7a8b9ff49dd761fc4f865ec6417980b3 (patch)
treea9b16342e9c93b05ea415764c2d95051c7518130 /modules
parent3b81518304f585505cbba577f46111fb25b88ace (diff)
downloadgsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar.gz
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar.bz2
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar.lz
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar.xz
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.tar.zst
gsoc2013-evolution-2862c6fe7a8b9ff49dd761fc4f865ec6417980b3.zip
ECalShellSidebar: Use e_source_registry_dup_unique_display_name().
Use a standard format for naming an ESource in user-visible messages.
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index a9e2b73254..a9ba205a1f 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -67,8 +67,7 @@ struct _ConnectClosure {
ECalShellSidebar *cal_shell_sidebar;
/* For error messages. */
- gchar *source_display_name;
- gchar *parent_display_name;
+ gchar *unique_display_name;
};
enum {
@@ -99,20 +98,15 @@ connect_closure_new (ECalShellSidebar *cal_shell_sidebar,
ConnectClosure *closure;
ESourceRegistry *registry;
ESourceSelector *selector;
- ESource *parent;
- const gchar *parent_uid;
selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar);
registry = e_source_selector_get_registry (selector);
- parent_uid = e_source_get_parent (source);
- parent = e_source_registry_ref_source (registry, parent_uid);
closure = g_slice_new0 (ConnectClosure);
closure->cal_shell_sidebar = g_object_ref (cal_shell_sidebar);
- closure->source_display_name = e_source_dup_display_name (source);
- closure->parent_display_name = e_source_dup_display_name (parent);
-
- g_object_unref (parent);
+ closure->unique_display_name =
+ e_source_registry_dup_unique_display_name (
+ registry, source, E_SOURCE_EXTENSION_CALENDAR);
return closure;
}
@@ -122,8 +116,7 @@ connect_closure_free (ConnectClosure *closure)
{
g_object_unref (closure->cal_shell_sidebar);
- g_free (closure->source_display_name);
- g_free (closure->parent_display_name);
+ g_free (closure->unique_display_name);
g_slice_free (ConnectClosure, closure);
}
@@ -157,8 +150,7 @@ cal_shell_sidebar_emit_status_message (ECalShellSidebar *cal_shell_sidebar,
static void
cal_shell_sidebar_handle_connect_error (ECalShellSidebar *cal_shell_sidebar,
- const gchar *parent_display_name,
- const gchar *source_display_name,
+ const gchar *unique_display_name,
const GError *error)
{
EShellView *shell_view;
@@ -185,15 +177,13 @@ cal_shell_sidebar_handle_connect_error (ECalShellSidebar *cal_shell_sidebar,
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:prompt-no-contents-offline-calendar",
- parent_display_name,
- source_display_name,
+ unique_display_name,
NULL);
} else {
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
- parent_display_name,
- source_display_name,
+ unique_display_name,
error->message,
NULL);
}
@@ -219,8 +209,7 @@ cal_shell_sidebar_client_connect_cb (GObject *source_object,
if (error != NULL) {
cal_shell_sidebar_handle_connect_error (
closure->cal_shell_sidebar,
- closure->parent_display_name,
- closure->source_display_name,
+ closure->unique_display_name,
error);
g_error_free (error);
goto exit;
@@ -263,8 +252,7 @@ cal_shell_sidebar_default_connect_cb (GObject *source_object,
if (error != NULL) {
cal_shell_sidebar_handle_connect_error (
closure->cal_shell_sidebar,
- closure->parent_display_name,
- closure->source_display_name,
+ closure->unique_display_name,
error);
g_error_free (error);
goto exit;