diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-02-22 08:10:22 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-02-22 08:10:22 +0800 |
commit | d28c85dd04ba77b30232c8c5dc1c5db3d4c14753 (patch) | |
tree | 19698fb20e5eb5ddf398bf9ffe023e30eea563d7 /tests | |
parent | 3b3a08b1de601f1ec9fd0d8f210b0ec49bfba1a1 (diff) | |
download | gsoc2013-evolution-d28c85dd04ba77b30232c8c5dc1c5db3d4c14753.tar.gz gsoc2013-evolution-d28c85dd04ba77b30232c8c5dc1c5db3d4c14753.tar.zst gsoc2013-evolution-d28c85dd04ba77b30232c8c5dc1c5db3d4c14753.zip |
A lot of changes in the way the parsing works. I am too lazy
to find all the changes.
Important notice, I added uggly hacks to camel-formatter.c
and message-browser so that I could test b64 decoding.
Saving streams works. Have to implement qp now.
svn path=/trunk/; revision=1893
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ui-tests/message-browser.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/ui-tests/message-browser.c b/tests/ui-tests/message-browser.c index 85b93b4778..328cde3bcf 100644 --- a/tests/ui-tests/message-browser.c +++ b/tests/ui-tests/message-browser.c @@ -256,9 +256,35 @@ static void on_link_clicked (GtkHTML *html, const gchar *url, gpointer data) { GtkWidget* message_box; + CamelStream *stream; + CamelStream *save_stream; + gchar tmp_buffer[4096]; + gint nb_bytes_read; + gchar* message = g_strdup_printf ("You have clicked on this link:\n%s", url); + sscanf (url, "camel://%p", &stream); + save_stream = camel_stream_fs_new_with_name ("saved-file", CAMEL_STREAM_FS_WRITE); + + + do { + + /* read next chunk of text */ + nb_bytes_read = camel_stream_read (stream, + tmp_buffer, + 4096); + + /* If there's any text, write it to the stream */ + if (nb_bytes_read > 0) { + camel_stream_write (save_stream, tmp_buffer, nb_bytes_read); + + } + + + } while (!camel_stream_eos (stream)); + camel_stream_close (save_stream); + message_box = gnome_message_box_new (message, GNOME_MESSAGE_BOX_INFO, "Okay", NULL); @@ -266,6 +292,8 @@ on_link_clicked (GtkHTML *html, const gchar *url, gpointer data) gnome_dialog_set_default (GNOME_DIALOG (message_box), 1); gnome_dialog_run (message_box); g_free (message); + + } |