aboutsummaryrefslogtreecommitdiff
path: root/src/im-application-list.c
diff options
context:
space:
mode:
authorNiklas Wenzel <nikwen.developer@gmail.com>2015-04-30 09:45:39 +0200
committerNiklas Wenzel <nikwen.developer@gmail.com>2015-04-30 09:45:39 +0200
commit5d4c62d7b80050b9c51dc7df77c00113e53bb442 (patch)
tree6763d4f754d766268e40a4eb009dba375218c0a9 /src/im-application-list.c
parentde0c62586869f6a6a2d093e3b352bc9db85c23b9 (diff)
downloadayatana-indicator-messages-5d4c62d7b80050b9c51dc7df77c00113e53bb442.tar.gz
ayatana-indicator-messages-5d4c62d7b80050b9c51dc7df77c00113e53bb442.tar.bz2
ayatana-indicator-messages-5d4c62d7b80050b9c51dc7df77c00113e53bb442.zip
Remove GArray and fix code style
Diffstat (limited to 'src/im-application-list.c')
-rw-r--r--src/im-application-list.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/im-application-list.c b/src/im-application-list.c
index 82025cc..272142a 100644
--- a/src/im-application-list.c
+++ b/src/im-application-list.c
@@ -522,30 +522,17 @@ im_application_list_remove_all (GSimpleAction *action,
if (app->proxy != NULL) /* If it is remote, we tell the app we've cleared */
{
- /* Unescape action names */
- GArray *unescaped_source_actions_array = g_array_new(TRUE, FALSE, sizeof(gchar*));
- for (it = source_actions; *it; it++)
- {
- gchar *action_name;
-
- action_name = unescape_action_name (*it);
-
- g_array_append_val(unescaped_source_actions_array, action_name);
- }
-
- gchar **unescaped_source_actions = (gchar**) g_array_free(unescaped_source_actions_array, FALSE);
+ gchar **unescaped_source_actions;
+ gchar **unescaped_message_actions;
- GArray *unescaped_message_actions_array = g_array_new(TRUE, FALSE, sizeof(gchar*));
- for (it = message_actions; *it; it++)
- {
- gchar *action_name;
-
- action_name = unescape_action_name (*it);
-
- g_array_append_val(unescaped_message_actions_array, action_name);
- }
+ /* Unescape action names */
+ unescaped_source_actions = g_new0 (gchar *, g_strv_length (source_actions) + 1);
+ for (i = 0; source_actions[i]; i++)
+ unescaped_source_actions[i] = unescape_action_name (source_actions[i]);
- gchar **unescaped_message_actions = (gchar**) g_array_free(unescaped_message_actions_array, FALSE);
+ unescaped_message_actions = g_new0 (gchar *, g_strv_length (message_actions) + 1);
+ for (i = 0; message_actions[i]; i++)
+ unescaped_message_actions[i] = unescape_action_name (message_actions[i]);
indicator_messages_application_call_dismiss (app->proxy,
(const gchar * const *) unescaped_source_actions,