aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-task-shell-view-actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/calendar/e-task-shell-view-actions.c')
-rw-r--r--modules/calendar/e-task-shell-view-actions.c41
1 files changed, 28 insertions, 13 deletions
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index 7f4fd08600..badfbf031d 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -139,12 +139,14 @@ action_task_list_copy_cb (GtkAction *action,
task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
- source = e_source_selector_get_primary_selection (selector);
- g_return_if_fail (E_IS_SOURCE (source));
+ source = e_source_selector_ref_primary_selection (selector);
+ g_return_if_fail (source != NULL);
copy_source_dialog (
GTK_WINDOW (shell_window),
source, E_CAL_CLIENT_SOURCE_TYPE_TASKS);
+
+ g_object_unref (source);
}
static void
@@ -179,16 +181,18 @@ action_task_list_delete_cb (GtkAction *action,
task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
- source = e_source_selector_get_primary_selection (selector);
- g_return_if_fail (E_IS_SOURCE (source));
+ source = e_source_selector_ref_primary_selection (selector);
+ g_return_if_fail (source != NULL);
/* Ask for confirmation. */
response = e_alert_run_dialog_for_args (
GTK_WINDOW (shell_window),
"calendar:prompt-delete-task-list",
- e_source_peek_name (source), NULL);
- if (response != GTK_RESPONSE_YES)
+ e_source_get_display_name (source), NULL);
+ if (response != GTK_RESPONSE_YES) {
+ g_object_unref (source);
return;
+ }
uri = e_source_get_uri (source);
client = e_cal_model_get_client_for_uri (model, uri);
@@ -205,6 +209,7 @@ action_task_list_delete_cb (GtkAction *action,
g_warning (
"%s: Failed to remove client: %s",
G_STRFUNC, error->message);
+ g_object_unref (source);
g_error_free (error);
return;
}
@@ -226,6 +231,8 @@ action_task_list_delete_cb (GtkAction *action,
G_STRFUNC, error->message);
g_error_free (error);
}
+
+ g_object_unref (source);
}
static void
@@ -285,10 +292,12 @@ action_task_list_properties_cb (GtkAction *action,
task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
- source = e_source_selector_get_primary_selection (selector);
- g_return_if_fail (E_IS_SOURCE (source));
+ source = e_source_selector_ref_primary_selection (selector);
+ g_return_if_fail (source != NULL);
calendar_setup_edit_task_list (GTK_WINDOW (shell_window), source);
+
+ g_object_unref (source);
}
static void
@@ -310,15 +319,17 @@ action_task_list_refresh_cb (GtkAction *action,
model = e_task_shell_content_get_task_model (task_shell_content);
selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
- source = e_source_selector_get_primary_selection (selector);
- g_return_if_fail (E_IS_SOURCE (source));
+ source = e_source_selector_ref_primary_selection (selector);
+ g_return_if_fail (source != NULL);
uri = e_source_get_uri (source);
client = e_cal_model_get_client_for_uri (model, uri);
g_free (uri);
- if (client == NULL)
+ if (client == NULL) {
+ g_object_unref (source);
return;
+ }
g_return_if_fail (e_client_check_refresh_supported (E_CLIENT (client)));
@@ -327,10 +338,12 @@ action_task_list_refresh_cb (GtkAction *action,
if (error != NULL) {
g_warning (
"%s: Failed to refresh '%s', %s",
- G_STRFUNC, e_source_peek_name (source),
+ G_STRFUNC, e_source_get_display_name (source),
error->message);
g_error_free (error);
}
+
+ g_object_unref (source);
}
static void
@@ -357,10 +370,12 @@ action_task_list_select_one_cb (GtkAction *action,
task_shell_sidebar = task_shell_view->priv->task_shell_sidebar;
selector = e_task_shell_sidebar_get_selector (task_shell_sidebar);
- primary = e_source_selector_get_primary_selection (selector);
+ primary = e_source_selector_ref_primary_selection (selector);
g_return_if_fail (primary != NULL);
e_source_selector_select_exclusive (selector, primary);
+
+ g_object_unref (primary);
}
static void