aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-threads.c
diff options
context:
space:
mode:
authorRadek Doulik <rodo@helixcode.com>2000-12-01 16:19:16 +0800
committerRadek Doulik <rodo@src.gnome.org>2000-12-01 16:19:16 +0800
commit2063939db42ac2baaa90113d4ebbb4bff1c9c91b (patch)
tree9e0863a3e85a1f6192009f8feceba3bbabc837a4 /mail/mail-threads.c
parent65e948466dc663faefb47329c5cd3fec1e006d72 (diff)
downloadgsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.gz
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.zst
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.zip
use mail_op_set_message_plain
2000-12-01 Radek Doulik <rodo@helixcode.com> * mail-ops.c (mail_op_report_status): use mail_op_set_message_plain * mail-threads.c (mail_op_set_message_plain): plain version of mail_op_set_message, doesn't use printf, passes message untouched, use set_message (mail_op_set_message): set_message (set_message): helper function svn path=/trunk/; revision=6753
Diffstat (limited to 'mail/mail-threads.c')
-rw-r--r--mail/mail-threads.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/mail/mail-threads.c b/mail/mail-threads.c
index 8e9365eac7..6491a936c5 100644
--- a/mail/mail-threads.c
+++ b/mail/mail-threads.c
@@ -387,6 +387,32 @@ mail_op_show_progressbar (void)
/**
* mail_op_set_message:
+ * @str: message
+ *
+ * Set the message displayed above the progress bar for the currently
+ * executing operation.
+ * Threadsafe for, nay, intended to be called by, the dispatching thread.
+ **/
+
+static void
+set_message (gchar *str)
+{
+ com_msg_t msg;
+
+ msg.type = MESSAGE;
+ msg.message = str;
+
+ pipe_write (MAIN_WRITER, &msg, sizeof (msg));
+}
+
+void
+mail_op_set_message_plain (const gchar *str)
+{
+ set_message (g_strdup (str));
+}
+
+/**
+ * mail_op_set_message:
* @fmt: printf-style format string for the message
* @...: arguments to the format string
*
@@ -398,15 +424,14 @@ mail_op_show_progressbar (void)
void
mail_op_set_message (const gchar *fmt, ...)
{
- com_msg_t msg;
+ gchar *str;
va_list val;
va_start (val, fmt);
- msg.type = MESSAGE;
- msg.message = g_strdup_vprintf (fmt, val);
+ str = g_strdup_vprintf (fmt, val);
va_end (val);
- pipe_write (MAIN_WRITER, &msg, sizeof (msg));
+ set_message (str);
}
/**