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

« back to all changes in this revision

Viewing changes to addressbook/backends/vcf/e-book-backend-vcf.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:
75
75
         * it's doubtful 2^32 id's will be created in a second, so we
76
76
         * should be okay. */
77
77
        static guint c = 0;
78
 
        return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time(NULL), c++);
 
78
        return g_strdup_printf (PAS_ID_PREFIX "%08lX%08X", time (NULL), c++);
79
79
}
80
80
 
81
81
static void
178
178
        }
179
179
 
180
180
        if (0 > g_rename (new_path, vcf->priv->filename)) {
181
 
                g_warning ("Failed to rename %s: %s\n", vcf->priv->filename, g_strerror(errno));
 
181
                g_warning ("Failed to rename %s: %s\n", vcf->priv->filename, g_strerror (errno));
182
182
                g_unlink (new_path);
183
183
                goto out;
184
184
        }
284
284
        if (vcards->next != NULL) {
285
285
                g_propagate_error (perror,
286
286
                                   EDB_ERROR_EX (NOT_SUPPORTED,
287
 
                                   _("The backend does not support bulk additions")));
 
287
                                   _("The backend does not support bulk additions")));
288
288
                return;
289
289
        }
290
290
 
316
316
        if (id_list->next != NULL) {
317
317
                g_propagate_error (perror,
318
318
                                   EDB_ERROR_EX (NOT_SUPPORTED,
319
 
                                   _("The backend does not support bulk removals")));
 
319
                                   _("The backend does not support bulk removals")));
320
320
                return;
321
321
        }
322
322
 
364
364
        if (vcards->next != NULL) {
365
365
                g_propagate_error (perror,
366
366
                                   EDB_ERROR_EX (NOT_SUPPORTED,
367
 
                                   _("The backend does not support bulk modifications")));
 
367
                                   _("The backend does not support bulk modifications")));
368
368
                return;
369
369
        }
370
370
 
462
462
static void
463
463
closure_destroy (VCFBackendSearchClosure *closure)
464
464
{
465
 
        d(printf ("destroying search closure\n"));
 
465
        d (printf ("destroying search closure\n"));
466
466
        e_flag_free (closure->running);
467
467
        g_free (closure);
468
468
}
509
509
        else
510
510
                e_data_book_view_notify_progress (book_view, -1, _("Searching..."));
511
511
 
512
 
        d(printf ("signalling parent thread\n"));
 
512
        d (printf ("signalling parent thread\n"));
513
513
        e_flag_set (closure->running);
514
514
 
515
515
        for (l = closure->bvcf->priv->contact_list; l; l = l->next) {
528
528
        /* unref the book view */
529
529
        e_data_book_view_unref (book_view);
530
530
 
531
 
        d(printf ("finished initial population of book view\n"));
 
531
        d (printf ("finished initial population of book view\n"));
532
532
 
533
533
        return NULL;
534
534
}
539
539
{
540
540
        VCFBackendSearchClosure *closure = init_closure (book_view, E_BOOK_BACKEND_VCF (backend));
541
541
 
542
 
        d(printf ("starting book view thread\n"));
 
542
        d (printf ("starting book view thread\n"));
543
543
        closure->thread = g_thread_create (book_view_thread, book_view, TRUE, NULL);
544
544
 
545
545
        e_flag_wait (closure->running);
546
546
 
547
547
        /* at this point we know the book view thread is actually running */
548
 
        d(printf ("returning from start_book_view\n"));
 
548
        d (printf ("returning from start_book_view\n"));
549
549
 
550
550
}
551
551
 
556
556
        VCFBackendSearchClosure *closure = get_closure (book_view);
557
557
        gboolean need_join;
558
558
 
559
 
        d(printf ("stopping query\n"));
 
559
        d (printf ("stopping query\n"));
560
560
        need_join = e_flag_is_set (closure->running);
561
561
        e_flag_clear (closure->running);
562
562
 
613
613
                                if (errno == EACCES || errno == EPERM) {
614
614
                                        g_propagate_error (perror, EDB_ERROR (PERMISSION_DENIED));
615
615
                                } else {
616
 
                                        g_propagate_error (perror, e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, "Failed to make directory %s: %s", dirname, g_strerror (errno)));
 
616
                                        g_propagate_error (perror, e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR, _("Failed to make directory %s: %s"), dirname, g_strerror (errno)));
617
617
                                }
618
618
                                goto exit;
619
619
                        }
638
638
 
639
639
        if (fd == -1) {
640
640
                g_warning ("Failed to open addressbook at `%s'", dirname);
641
 
                g_warning ("error == %s", g_strerror(errno));
 
641
                g_warning ("error == %s", g_strerror (errno));
642
642
                g_propagate_error (
643
643
                        perror, e_data_book_create_error_fmt (
644
644
                        E_DATA_BOOK_STATUS_OTHER_ERROR,
645
 
                        "Failed to open addressbook at '%s': %s",
 
645
                        _("Failed to open addressbook at '%s': %s"),
646
646
                        dirname, g_strerror (errno)));
647
647
                goto exit;
648
648
        }