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

« back to all changes in this revision

Viewing changes to addressbook/libedata-book/e-book-backend-factory.c

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2015-07-20 13:34:59 UTC
  • mfrom: (1.1.126) (1.2.48 sid)
  • Revision ID: package-import@ubuntu.com-20150720133459-g6y46hnu5ewtoz08
Tags: 3.16.4-0ubuntu2
debian/patches/0001-Bug-752373-Monthly-events-do-not-recur-correctly.patch:
Cherry-pick patch from upstream to fix events not recurring correctly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
2
/*
3
 
 *
4
 
 * Author:
5
 
 *   Chris Toshok (toshok@ximian.com)
6
 
 *
7
3
 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
 
4
 *
 
5
 * This library is free software: you can redistribute it and/or modify it
 
6
 * under the terms of the GNU Lesser General Public License as published by
 
7
 * the Free Software Foundation.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful, but
 
10
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
11
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 
12
 * for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public License
 
15
 * along with this library. If not, see <http://www.gnu.org/licenses/>.
 
16
 *
 
17
 * Authors: Chris Toshok (toshok@ximian.com)
8
18
 */
9
19
 
10
20
/**
17
27
 **/
18
28
 
19
29
#include <config.h>
 
30
#include <string.h>
20
31
 
21
32
#include "e-book-backend.h"
22
33
#include "e-book-backend-factory.h"
41
52
book_backend_factory_get_hash_key (EBackendFactory *factory)
42
53
{
43
54
        EBookBackendFactoryClass *class;
 
55
        const gchar *component_name;
 
56
        gchar *hash_key;
 
57
        gsize length;
44
58
 
45
59
        class = E_BOOK_BACKEND_FACTORY_GET_CLASS (factory);
46
60
        g_return_val_if_fail (class->factory_name != NULL, NULL);
47
61
 
48
 
        /* For address book backends the factory hash key is simply
49
 
         * the factory name.  See ECalBackendFactory for a slightly
50
 
         * more complex scheme. */
51
 
 
52
 
        return class->factory_name;
 
62
        component_name = E_SOURCE_EXTENSION_ADDRESS_BOOK;
 
63
 
 
64
        /* Hash Key: FACTORY_NAME ':' COMPONENT_NAME */
 
65
        length = strlen (class->factory_name) + strlen (component_name) + 2;
 
66
        hash_key = g_alloca (length);
 
67
        g_snprintf (
 
68
                hash_key, length, "%s:%s",
 
69
                class->factory_name, component_name);
 
70
 
 
71
        return g_intern_string (hash_key);
53
72
}
54
73
 
55
74
static EBackend *
65
84
                class->backend_type, E_TYPE_BOOK_BACKEND), NULL);
66
85
 
67
86
        data_factory = book_backend_factory_get_data_factory (factory);
68
 
        registry = e_data_book_factory_get_registry (data_factory);
 
87
        registry = e_data_factory_get_registry (E_DATA_FACTORY (data_factory));
69
88
 
70
89
        return g_object_new (
71
90
                class->backend_type,