diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-03-28 17:14:23 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2014-03-28 18:44:44 +0800 |
commit | 61b4bacf9a16bf69c26999dd9acac99695d23242 (patch) | |
tree | 01ec1df06524350dc665913445f14bbf8e0dad58 /modules/calendar | |
parent | ed405f45a5b870b0374f8f714023e1647a1a6701 (diff) | |
download | gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar.gz gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar.bz2 gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar.lz gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar.xz gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.tar.zst gsoc2013-evolution-61b4bacf9a16bf69c26999dd9acac99695d23242.zip |
e-util: Port to thread-safe ECategories API
This ports the following two function calls throughout Evolution:
• e_categories_get_list() to e_categories_dup_list()
• e_categories_get_icon_file_for() to e_categories_dup_icon_file_for()
It necessarily changes some internal e-util API:
• e_util_get_searchable_categories() to
e_util_dup_searchable_categories()
This bumps the EDS requirement to 3.13.1.
https://bugzilla.gnome.org/show_bug.cgi?id=727221
Diffstat (limited to 'modules/calendar')
-rw-r--r-- | modules/calendar/e-cal-shell-view-actions.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-view.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view-actions.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-view.c | 4 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view-actions.c | 10 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-view.c | 4 |
6 files changed, 24 insertions, 18 deletions
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 62a5dc2459..660be9c267 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1957,10 +1957,10 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view) /* Build the category actions. */ - list = e_util_get_searchable_categories (); + list = e_util_dup_searchable_categories (); for (iter = list, ii = 0; iter != NULL; iter = iter->next, ii++) { const gchar *category_name = iter->data; - const gchar *filename; + gchar *filename; GtkAction *action; gchar *action_name; @@ -1971,7 +1971,7 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view) g_free (action_name); /* Convert the category icon file to a themed icon name. */ - filename = e_categories_get_icon_file_for (category_name); + filename = e_categories_dup_icon_file_for (category_name); if (filename != NULL && *filename != '\0') { gchar *basename; gchar *cp; @@ -1988,6 +1988,8 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view) g_free (basename); } + g_free (filename); + gtk_radio_action_set_group (radio_action, group); group = gtk_radio_action_get_group (radio_action); @@ -1996,7 +1998,7 @@ e_cal_shell_view_update_search_filter (ECalShellView *cal_shell_view) gtk_action_group_add_action (action_group, action); g_object_unref (radio_action); } - g_list_free (list); + g_list_free_full (list, g_free); cal_shell_content = cal_shell_view->priv->cal_shell_content; searchbar = e_cal_shell_content_get_searchbar (cal_shell_content); diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 716f87eb4c..a703cbc076 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -296,9 +296,9 @@ cal_shell_view_execute_search (EShellView *shell_view) GList *categories; const gchar *category_name; - categories = e_util_get_searchable_categories (); + categories = e_util_dup_searchable_categories (); category_name = g_list_nth_data (categories, value); - g_list_free (categories); + g_list_free_full (categories, g_free); temp = g_strdup_printf ( "(and (has-categories? \"%s\") %s)", diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c index 21a1b5b58a..cea084e293 100644 --- a/modules/calendar/e-memo-shell-view-actions.c +++ b/modules/calendar/e-memo-shell-view-actions.c @@ -991,10 +991,10 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view) /* Build the category actions. */ - list = e_util_get_searchable_categories (); + list = e_util_dup_searchable_categories (); for (iter = list, ii = 0; iter != NULL; iter = iter->next, ii++) { const gchar *category_name = iter->data; - const gchar *filename; + gchar *filename; GtkAction *action; gchar *action_name; @@ -1005,7 +1005,7 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view) g_free (action_name); /* Convert the category icon file to a themed icon name. */ - filename = e_categories_get_icon_file_for (category_name); + filename = e_categories_dup_icon_file_for (category_name); if (filename != NULL && *filename != '\0') { gchar *basename; gchar *cp; @@ -1022,6 +1022,8 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view) g_free (basename); } + g_free (filename); + gtk_radio_action_set_group (radio_action, group); group = gtk_radio_action_get_group (radio_action); @@ -1030,7 +1032,7 @@ e_memo_shell_view_update_search_filter (EMemoShellView *memo_shell_view) gtk_action_group_add_action (action_group, action); g_object_unref (radio_action); } - g_list_free (list); + g_list_free_full (list, g_free); memo_shell_content = memo_shell_view->priv->memo_shell_content; searchbar = e_memo_shell_content_get_searchbar (memo_shell_content); diff --git a/modules/calendar/e-memo-shell-view.c b/modules/calendar/e-memo-shell-view.c index 8bd49fc871..8f8522c50f 100644 --- a/modules/calendar/e-memo-shell-view.c +++ b/modules/calendar/e-memo-shell-view.c @@ -144,9 +144,9 @@ memo_shell_view_execute_search (EShellView *shell_view) GList *categories; const gchar *category_name; - categories = e_util_get_searchable_categories (); + categories = e_util_dup_searchable_categories (); category_name = g_list_nth_data (categories, value); - g_list_free (categories); + g_list_free_full (categories, g_free); temp = g_strdup_printf ( "(and (has-categories? \"%s\") %s)", diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 10c1d1ecbe..99754570aa 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -1190,10 +1190,10 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view) /* Build the category actions. */ - list = e_util_get_searchable_categories (); + list = e_util_dup_searchable_categories (); for (iter = list, ii = 0; iter != NULL; iter = iter->next, ii++) { const gchar *category_name = iter->data; - const gchar *filename; + gchar *filename; GtkAction *action; gchar *action_name; @@ -1204,7 +1204,7 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view) g_free (action_name); /* Convert the category icon file to a themed icon name. */ - filename = e_categories_get_icon_file_for (category_name); + filename = e_categories_dup_icon_file_for (category_name); if (filename != NULL && *filename != '\0') { gchar *basename; gchar *cp; @@ -1221,6 +1221,8 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view) g_free (basename); } + g_free (filename); + gtk_radio_action_set_group (radio_action, group); group = gtk_radio_action_get_group (radio_action); @@ -1229,7 +1231,7 @@ e_task_shell_view_update_search_filter (ETaskShellView *task_shell_view) gtk_action_group_add_action (action_group, action); g_object_unref (radio_action); } - g_list_free (list); + g_list_free_full (list, g_free); task_shell_content = task_shell_view->priv->task_shell_content; searchbar = e_task_shell_content_get_searchbar (task_shell_content); diff --git a/modules/calendar/e-task-shell-view.c b/modules/calendar/e-task-shell-view.c index 7996e82e7a..81538694d5 100644 --- a/modules/calendar/e-task-shell-view.c +++ b/modules/calendar/e-task-shell-view.c @@ -254,9 +254,9 @@ task_shell_view_execute_search (EShellView *shell_view) GList *categories; const gchar *category_name; - categories = e_util_get_searchable_categories (); + categories = e_util_dup_searchable_categories (); category_name = g_list_nth_data (categories, value); - g_list_free (categories); + g_list_free_full (categories, g_free); temp = g_strdup_printf ( "(and (has-categories? \"%s\") %s)", |