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

« back to all changes in this revision

Viewing changes to camel/providers/imap/camel-imap-wrapper.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:
34
34
#include "camel-mime-filter-crlf.h"
35
35
#include "camel-mime-part.h"
36
36
#include "camel-stream-filter.h"
 
37
#include "camel-service.h"
 
38
#include "camel-url.h"
37
39
 
38
40
#include "camel-imap-folder.h"
39
41
#include "camel-imap-wrapper.h"
134
136
 
135
137
        CAMEL_IMAP_WRAPPER_LOCK (imap_wrapper, lock);
136
138
        if (data_wrapper->offline) {
 
139
                CamelException ex = CAMEL_EXCEPTION_INITIALISER;
137
140
                CamelStream *datastream;
138
141
 
139
142
                datastream = camel_imap_folder_fetch_data (
140
143
                        imap_wrapper->folder, imap_wrapper->uid,
141
 
                        imap_wrapper->part_spec, FALSE, NULL);
 
144
                        imap_wrapper->part_spec, FALSE, &ex);
 
145
 
 
146
                camel_exception_clear (&ex);
 
147
 
142
148
                if (!datastream) {
143
149
                        CAMEL_IMAP_WRAPPER_UNLOCK (imap_wrapper, lock);
144
150
#ifdef ENETUNREACH
165
171
                        CamelMimePart *part)
166
172
{
167
173
        CamelImapWrapper *imap_wrapper;
 
174
        CamelStore *store = (((CamelFolder *) imap_folder)->parent_store);
168
175
        CamelStream *stream;
 
176
        gboolean sync_offline = FALSE;
 
177
 
 
178
        sync_offline = (camel_url_get_param (((CamelService *) store)->url, "sync_offline") != NULL ||
 
179
                                        ((CamelOfflineFolder *)imap_folder)->sync_offline);
169
180
 
170
181
        imap_wrapper = (CamelImapWrapper *)camel_object_new(camel_imap_wrapper_get_type());
171
 
 
172
182
        camel_data_wrapper_set_mime_type_field (CAMEL_DATA_WRAPPER (imap_wrapper), type);
173
 
        ((CamelDataWrapper *)imap_wrapper)->offline = TRUE;
 
183
        ((CamelDataWrapper *)imap_wrapper)->offline = !sync_offline;
174
184
        ((CamelDataWrapper *)imap_wrapper)->encoding = encoding;
175
185
 
176
186
        imap_wrapper->folder = imap_folder;
181
191
        /* Don't ref this, it's our parent. */
182
192
        imap_wrapper->part = part;
183
193
 
184
 
        /* Try the cache. */
 
194
        /* Download the attachments if sync_offline is set, else skip them by checking only in cache */
185
195
        stream = camel_imap_folder_fetch_data (imap_folder, uid, part_spec,
186
 
                                               TRUE, NULL);
 
196
                        !sync_offline, NULL);
 
197
 
187
198
        if (stream) {
188
199
                imap_wrapper_hydrate (imap_wrapper, stream);
189
200
                camel_object_unref (stream);