~ci-train-bot/address-book-service/address-book-service-ubuntu-yakkety-landing-1774

« back to all changes in this revision

Viewing changes to eds-extension/module-ubuntu-sources.c

  • Committer: Bileto Bot
  • Author(s): Renato Araujo Oliveira Filho
  • Date: 2016-07-11 15:01:47 UTC
  • mfrom: (207.1.7 create-eds-extension-package)
  • Revision ID: ci-train-bot@canonical.com-20160711150147-0p8v3aerd8zjn2kx
Created a debian package "evolution-data-server-ubuntu" to used by others projects.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
    GSList *link;
129
129
    GQueue trash = G_QUEUE_INIT;
130
130
 
 
131
    if (ag_account_id == 0) {
 
132
        return;
 
133
    }
 
134
 
131
135
    server = ubuntu_sources_get_server (extension);
132
136
 
133
137
    eds_id_list = g_hash_table_lookup (extension->uoa_to_eds,
166
170
{
167
171
    ESourceUbuntu *ubuntu_ext;
168
172
    AgAccountId ag_account_id;
169
 
    AgAccount *ag_account;
 
173
    AgAccount *ag_account = NULL;
170
174
 
171
175
    g_debug("Register new source: %s/%s", e_source_get_display_name(source),
172
176
            e_source_get_uid(source));
173
177
 
174
178
    if (!e_source_has_extension (source, E_SOURCE_EXTENSION_UBUNTU)) {
 
179
        g_debug("\tSource does not have ubuntu extension!");
175
180
        return FALSE;
176
181
    }
177
182
 
178
183
    ubuntu_ext = e_source_get_extension (source, E_SOURCE_EXTENSION_UBUNTU);
179
184
    ag_account_id = e_source_ubuntu_get_account_id (ubuntu_ext);
180
 
    ag_account = ag_manager_get_account (extension->ag_manager,
181
 
                                         ag_account_id);
 
185
    if (ag_account_id > 0) {
 
186
        ag_account = ag_manager_get_account (extension->ag_manager,
 
187
                                             ag_account_id);
 
188
    } else {
 
189
        // accept sources with empty account
 
190
        return TRUE;
 
191
    }
182
192
 
183
193
    if (ag_account) {
184
194
        GSList *eds_id_list;
300
310
{
301
311
    g_debug("loading ubuntu sources");
302
312
 
 
313
    if (extension->ag_manager != NULL)
 
314
        return;
 
315
 
303
316
    extension->ag_manager = ag_manager_new ();
304
317
 
305
318
    /* This populates a hash table of UOA ID -> ESource UID strings by
410
423
static void
411
424
e_ubuntu_sources_init (EUbuntuSources *extension)
412
425
{
 
426
    extension->ag_manager = NULL;
413
427
    extension->uoa_to_eds = g_hash_table_new_full (
414
428
        (GHashFunc) g_direct_hash,
415
429
        (GEqualFunc) g_direct_equal,