~ubuntu-branches/ubuntu/saucy/evolution-data-server/saucy

« back to all changes in this revision

Viewing changes to camel/providers/local/camel-maildir-folder.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2012-10-08 12:58:16 UTC
  • mfrom: (181.1.7 quantal)
  • Revision ID: package-import@ubuntu.com-20121008125816-i3n76e8c0m64e7xp
Tags: 3.6.0-0ubuntu2
* Fix LP: #1038047 part 1 - Don't abort in e_source_registry_new* when a
  problem occurs connecting to the Dbus service
  - add debian/patches/dont-abort-in-e_source_registry_new.patch
  - update debian/patches/series
* Fix LP: #1038047 part 2 - libedataserver depends on
  evolution-data-server-common to ensure that the GSettings schemas are
  present
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
160
160
        gchar *name, *dest = NULL;
161
161
        gboolean success = TRUE, has_attachment;
162
162
 
163
 
        d(printf("Appending message\n"));
 
163
        d (printf ("Appending message\n"));
164
164
 
165
165
        /* If we can't lock, don't do anything */
166
166
        if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
181
181
 
182
182
        mdi = (CamelMaildirMessageInfo *) mi;
183
183
 
184
 
        d(printf("Appending message: uid is %s filename is %s\n", camel_message_info_uid(mi), mdi->filename));
 
184
        d (printf ("Appending message: uid is %s filename is %s\n", camel_message_info_uid (mi), mdi->filename));
185
185
 
186
186
        /* write it out to tmp, use the uid we got from the summary */
187
 
        name = g_strdup_printf ("%s/tmp/%s", lf->folder_path, camel_message_info_uid(mi));
 
187
        name = g_strdup_printf ("%s/tmp/%s", lf->folder_path, camel_message_info_uid (mi));
188
188
        output_stream = camel_stream_fs_new_with_name (
189
189
                name, O_WRONLY | O_CREAT, 0600, error);
190
190
        if (output_stream == NULL)
196
196
                goto fail_write;
197
197
 
198
198
        /* now move from tmp to cur (bypass new, does it matter?) */
199
 
        dest = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
 
199
        dest = g_strdup_printf ("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
200
200
        if (g_rename (name, dest) == -1) {
201
201
                g_set_error (
202
202
                        error, G_IO_ERROR,
219
219
 fail_write:
220
220
 
221
221
        /* remove the summary info so we are not out-of-sync with the mh folder */
222
 
        camel_folder_summary_remove_uid (CAMEL_FOLDER_SUMMARY (folder->summary),
223
 
                                         camel_message_info_uid (mi));
 
222
        camel_folder_summary_remove (CAMEL_FOLDER_SUMMARY (folder->summary), mi);
224
223
 
225
224
        g_prefix_error (
226
225
                error, _("Cannot append message to maildir folder: %s: "),
258
257
        CamelMimeMessage *message = NULL;
259
258
        gchar *name = NULL;
260
259
 
261
 
        d(printf("getting message: %s\n", uid));
 
260
        d (printf ("getting message: %s\n", uid));
262
261
 
263
262
        if (!lf || camel_local_folder_lock (lf, CAMEL_LOCK_WRITE, error) == -1)
264
263
                return NULL;
341
340
                        new_filename = camel_maildir_summary_info_to_name (mdi);
342
341
 
343
342
                        d_filename = g_strdup_printf ("%s/cur/%s", df->folder_path, new_filename);
344
 
                        s_filename = g_strdup_printf("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
 
343
                        s_filename = g_strdup_printf ("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
345
344
 
346
345
                        if (g_rename (s_filename, d_filename) != 0) {
347
346
                                if (errno == EXDEV) {
468
467
        gboolean filter_inbox;
469
468
        gchar *basename;
470
469
 
471
 
        d(printf("Creating maildir folder: %s\n", full_name));
 
470
        d (printf ("Creating maildir folder: %s\n", full_name));
472
471
 
473
472
        if (g_strcmp0 (full_name, ".") == 0)
474
473
                basename = g_strdup (_("Inbox"));
483
482
                NULL);
484
483
 
485
484
        service = CAMEL_SERVICE (parent_store);
486
 
        settings = camel_service_get_settings (service);
 
485
 
 
486
        settings = camel_service_ref_settings (service);
487
487
 
488
488
        filter_inbox = camel_store_settings_get_filter_inbox (
489
489
                CAMEL_STORE_SETTINGS (settings));
490
490
 
491
 
        if (filter_inbox && strcmp (full_name, ".") == 0)
 
491
        g_object_unref (settings);
 
492
 
 
493
        if (filter_inbox && (g_str_equal (full_name, ".") || g_ascii_strcasecmp (full_name, "Inbox") == 0))
492
494
                folder->folder_flags |= CAMEL_FOLDER_FILTER_RECENT;
493
495
 
494
496
        folder = (CamelFolder *) camel_local_folder_construct (