+ /* Use g_idle to context-switch into the application's thread: */
+ ComposeMailIdleData *idle_data = g_new0(ComposeMailIdleData, 1); /* Freed in the idle callback. */
+
+ /* Get the arguments: */
+ osso_rpc_t val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_TO);
+ idle_data->to = g_strdup (val.value.s);
+
+ val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_CC);
+ idle_data->cc = g_strdup (val.value.s);
+
+ val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_BCC);
+ idle_data->bcc = g_strdup (val.value.s);
+
+ val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_SUBJECT);
+ idle_data->subject = g_strdup (val.value.s);
+
+ val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_BODY);
+ idle_data->body = g_strdup (val.value.s);
+
+ val = g_array_index(arguments, osso_rpc_t, MODEST_DEBUS_COMPOSE_MAIL_ARG_ATTACHMENTS);
+ gchar *attachments_str = g_strdup (val.value.s);
+
+ list = g_strsplit(attachments_str, ",", 0);
+ for (i=0; list[i] != NULL; i++) {
+ idle_data->attachments = g_slist_append(idle_data->attachments, g_strdup(list[i]));
+ }
+ g_strfreev(list);