aboutsummaryrefslogtreecommitdiffstats
path: root/mail
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
parent65e948466dc663faefb47329c5cd3fec1e006d72 (diff)
downloadgsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.gz
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.bz2
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.lz
gsoc2013-evolution-2063939db42ac2baaa90113d4ebbb4bff1c9c91b.tar.xz
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')
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/mail-ops.c2
-rw-r--r--mail/mail-threads.c33
-rw-r--r--mail/mail-threads.h1
4 files changed, 41 insertions, 5 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index bd6c125047..c6fba1cfff 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+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
+
2000-11-30 Jeffrey Stedfast <fejj@helixcode.com>
* mail-ops.c (cleanup_fetch_mail): Don't display a dialog, instead
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 9052eaed3b..77d3aa564e 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -117,7 +117,7 @@ mail_op_report_status (FilterDriver *driver, enum filter_status_t status, const
/* FIXME: make it work */
switch (status) {
case FILTER_STATUS_START:
- mail_op_set_message (desc);
+ mail_op_set_message_plain (desc);
break;
case FILTER_STATUS_END:
break;
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);
}
/**
diff --git a/mail/mail-threads.h b/mail/mail-threads.h
index d3872276f3..83a78e782a 100644
--- a/mail/mail-threads.h
+++ b/mail/mail-threads.h
@@ -58,6 +58,7 @@ void mail_op_hide_progressbar (void);
void mail_op_show_progressbar (void);
#endif
+void mail_op_set_message_plain (const gchar *str);
void mail_op_set_message (const gchar *fmt, ...) G_GNUC_PRINTF (1, 2);
void mail_op_error (gchar * fmt, ...) G_GNUC_PRINTF (1, 2);
gboolean mail_op_get_password (gchar * prompt, gboolean secret,