Commit a55f24df authored by Matthew Barnes's avatar Matthew Barnes
Browse files

Adapt to CamelSession API changes.

parent 27ac2039
......@@ -155,7 +155,7 @@ struct _user_message_msg {
EUserPrompter *prompter;
CamelSessionAlertType type;
gchar *prompt;
GSList *button_captions;
GList *button_captions;
EFlag *done;
gint result;
......@@ -232,7 +232,7 @@ static void
user_message_free (struct _user_message_msg *m)
{
g_free (m->prompt);
g_slist_free_full (m->button_captions, g_free);
g_list_free_full (m->button_captions, g_free);
e_flag_free (m->done);
if (m->prompter)
......@@ -1374,24 +1374,21 @@ static gint
mail_session_alert_user (CamelSession *session,
CamelSessionAlertType type,
const gchar *prompt,
GSList *button_captions,
GList *button_captions,
GCancellable *cancellable)
{
struct _user_message_msg *m;
gint result = -1;
GSList *iter;
m = mail_msg_new (&user_message_info);
m->ismain = mail_in_main_thread ();
m->type = type;
m->prompt = g_strdup (prompt);
m->done = e_flag_new ();
m->button_captions = g_slist_copy (button_captions);
m->button_captions = g_list_copy_deep (
button_captions, (GCopyFunc) g_strdup, NULL);
for (iter = m->button_captions; iter; iter = iter->next)
iter->data = g_strdup (iter->data);
if (g_slist_length (button_captions) > 1)
if (g_list_length (button_captions) > 1)
mail_msg_ref (m);
if (m->ismain)
......@@ -1399,7 +1396,7 @@ mail_session_alert_user (CamelSession *session,
else
mail_msg_main_loop_push (m);
if (g_slist_length (button_captions) > 1) {
if (g_list_length (button_captions) > 1) {
e_flag_wait (m->done);
result = m->result;
mail_msg_unref (m);
......@@ -1414,14 +1411,14 @@ mail_session_trust_prompt (CamelSession *session,
const gchar *host,
const gchar *certificate,
guint32 certificate_errors,
const GSList *issuers,
GList *issuers,
GCancellable *cancellable)
{
EUserPrompter *prompter;
ENamedParameters *parameters;
CamelCertTrust response;
gchar *errors_code;
const GSList *iter;
GList *iter;
gint ii;
prompter = e_user_prompter_new ();
......
......@@ -116,7 +116,7 @@ struct _user_message_msg {
CamelSessionAlertType type;
gchar *prompt;
GSList *button_captions;
GList *button_captions;
EFlag *done;
gint result;
......@@ -173,9 +173,9 @@ user_message_exec (struct _user_message_msg *m,
EShell *shell;
const gchar *error_type;
gint index;
GSList *iter;
GList *iter;
info_only = g_slist_length (m->button_captions) <= 1;
info_only = g_list_length (m->button_captions) <= 1;
if (!m->ismain && user_message_dialog != NULL && !info_only) {
g_queue_push_tail (&user_message_queue, mail_msg_ref (m));
......@@ -284,7 +284,7 @@ user_message_exec (struct _user_message_msg *m,
} else {
gpointer user_data = m;
if (g_slist_length (m->button_captions) <= 1)
if (g_list_length (m->button_captions) <= 1)
user_data = NULL;
g_signal_connect (
......@@ -298,7 +298,7 @@ static void
user_message_free (struct _user_message_msg *m)
{
g_free (m->prompt);
g_slist_free_full (m->button_captions, g_free);
g_list_free_full (m->button_captions, g_free);
e_flag_free (m->done);
}
......@@ -622,24 +622,21 @@ gint
e_mail_ui_session_alert_user (CamelSession *session,
CamelSessionAlertType type,
const gchar *prompt,
GSList *button_captions,
GList *button_captions,
GCancellable *cancellable)
{
struct _user_message_msg *m;
gint result = -1;
GSList *iter;
m = mail_msg_new (&user_message_info);
m->ismain = mail_in_main_thread ();
m->type = type;
m->prompt = g_strdup (prompt);
m->done = e_flag_new ();
m->button_captions = g_slist_copy (button_captions);
m->button_captions = g_list_copy_deep (
button_captions, (GCopyFunc) g_strdup, NULL);
for (iter = m->button_captions; iter; iter = iter->next)
iter->data = g_strdup (iter->data);
if (g_slist_length (button_captions) > 1)
if (g_list_length (button_captions) > 1)
mail_msg_ref (m);
if (!cancellable)
......@@ -650,7 +647,7 @@ e_mail_ui_session_alert_user (CamelSession *session,
else
mail_msg_main_loop_push (m);
if (g_slist_length (button_captions) > 1) {
if (g_list_length (button_captions) > 1) {
e_flag_wait (m->done);
result = m->result;
mail_msg_unref (m);
......@@ -665,7 +662,7 @@ e_mail_ui_session_trust_prompt (CamelSession *session,
const gchar *host,
const gchar *certificate,
guint32 certificate_errors,
const GSList *issuers,
GList *issuers,
GCancellable *cancellable)
{
g_type_ensure (E_TYPE_MAIL_UI_SESSION);
......
......@@ -87,13 +87,13 @@ void e_mail_ui_session_add_activity (EMailUISession *session,
gint e_mail_ui_session_alert_user (CamelSession *session,
CamelSessionAlertType type,
const gchar *prompt,
GSList *button_captions,
GList *button_captions,
GCancellable *cancellable);
CamelCertTrust e_mail_ui_session_trust_prompt (CamelSession *session,
const gchar *host,
const gchar *certificate,
guint32 certificate_errors,
const GSList *issuers,
GList *issuers,
GCancellable *cancellable);
G_END_DECLS
......
......@@ -206,13 +206,13 @@ trust_prompt_sync (const ENamedParameters *parameters,
#endif
if (!asked) {
GSList *button_captions = NULL;
GList *button_captions = NULL;
const gchar *markup;
gchar *tmp = NULL;
button_captions = g_slist_append (button_captions, _("_Reject"));
button_captions = g_slist_append (button_captions, _("Accept _Temporarily"));
button_captions = g_slist_append (button_captions, _("_Accept Permanently"));
button_captions = g_list_append (button_captions, _("_Reject"));
button_captions = g_list_append (button_captions, _("Accept _Temporarily"));
button_captions = g_list_append (button_captions, _("_Accept Permanently"));
markup = e_named_parameters_get (parameters, "markup");
if (!markup) {
......@@ -233,7 +233,7 @@ trust_prompt_sync (const ENamedParameters *parameters,
else if (response == 2)
response = 1;
g_slist_free (button_captions);
g_list_free (button_captions);
g_free (tmp);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment