~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/camel-mime-part-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
78
78
        camel_object_unref (mem);
79
79
}
80
80
 
81
 
/* This replaces the data wrapper repository ... and/or could be replaced by it? */
 
81
/**
 
82
 * camel_mime_part_construct_content_from_parser:
 
83
 *
 
84
 * Since: 2.24
 
85
 **/
82
86
void
83
87
camel_mime_part_construct_content_from_parser (CamelMimePart *dw, CamelMimeParser *mp)
84
88
{
86
90
        CamelContentType *ct;
87
91
        gchar *encoding;
88
92
 
 
93
        /* This replaces the data wrapper repository ... and/or could be
 
94
         * replaced by it? */
 
95
 
89
96
        if (!dw)
90
97
                return;
91
98
 
139
146
        g_free (encoding);
140
147
}
141
148
 
 
149
/**
 
150
 * camel_mime_message_build_preview:
 
151
 *
 
152
 * Since: 2.28
 
153
 **/
142
154
gboolean
143
155
camel_mime_message_build_preview (CamelMimePart *msg, CamelMessageInfo *info)
144
156
{
145
 
        gchar *mime_type;
146
157
        CamelDataWrapper *dw;
147
158
        gboolean got_plain = FALSE;
148
159
 
149
160
        dw = camel_medium_get_content_object((CamelMedium *)msg);
150
 
        mime_type = camel_data_wrapper_get_mime_type(dw);
151
161
        if (camel_content_type_is (dw->mime_type, "multipart", "*")) {
152
162
                gint i, nparts;
153
163
                CamelMultipart *mp = (CamelMultipart *)camel_medium_get_content_object((CamelMedium *)msg);
161
171
                }
162
172
 
163
173
        } else if (camel_content_type_is (dw->mime_type, "text", "*") &&
164
 
                //    !camel_content_type_is (dw->mime_type, "text", "html") &&
 
174
                /*    !camel_content_type_is (dw->mime_type, "text", "html") && */
165
175
                    !camel_content_type_is (dw->mime_type, "text", "calendar")) {
166
176
                CamelStream *mstream, *bstream;
167
177
                mstream = camel_stream_mem_new();
168
178
                if (camel_data_wrapper_decode_to_stream (dw, mstream) > 0) {
169
179
                        gchar *line = NULL;
170
 
                        gboolean stop = FALSE;
171
180
                        GString *str = g_string_new (NULL);
172
181
 
173
182
                        camel_stream_reset (mstream);
174
183
                        bstream = camel_stream_buffer_new (mstream, CAMEL_STREAM_BUFFER_READ|CAMEL_STREAM_BUFFER_BUFFER);
175
184
 
176
185
                        /* We should fetch just 200 unquoted lines. */
177
 
                        while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)bstream)) && !stop && str->len < 200) {
 
186
                        while ((line = camel_stream_buffer_read_line((CamelStreamBuffer *)bstream)) && str->len < 200) {
178
187
                                gchar *tmp = line;
179
188
                                if (!line)
180
189
                                        continue;
183
192
                                        g_free(tmp);
184
193
                                        continue;
185
194
                                }
186
 
                                if (line [0]== '-' && line[1] == '-') {
 
195
                                if (g_str_has_prefix (line, "--")) {
187
196
                                        g_free(tmp);
188
 
                                        stop = TRUE;
189
197
                                        line = NULL;
190
198
                                        break;
191
199
                                }