diff options
author | Alexander Larsson <alexl@redhat.com> | 2011-09-20 11:10:04 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2011-09-20 12:30:24 +0200 |
commit | 2a6781207f81ad513623f38681a372e2de6c0e8a (patch) | |
tree | 0901527c51840655453ad87d92b6d7f81c9228ea | |
parent | 14cd79f109cbe6b933eb7a2045624e5c06ad3e26 (diff) | |
download | gnome-contacts-2a6781207f81ad513623f38681a372e2de6c0e8a.tar.gz |
Mark GOA source as default if there is no default
https://bugzilla.gnome.org/show_bug.cgi?id=659049
-rw-r--r-- | src/contacts-esd-setup.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/contacts-esd-setup.c b/src/contacts-esd-setup.c index 23f8ee0..3021ab1 100644 --- a/src/contacts-esd-setup.c +++ b/src/contacts-esd-setup.c @@ -76,6 +76,17 @@ search_known_sources (ESourceList *sources, } static gboolean +check_default (ESource *source, + gpointer data) +{ + + if (e_source_get_property (source, "default")) + return TRUE; + + return FALSE; +} + +static gboolean check_uri (ESource *source, gpointer uri) { @@ -234,6 +245,10 @@ online_accounts_google_sync_contacts (GoaObject *goa_object, g_object_unref (source); } + /* If there is no current default then we likely want to use the GOA source by default. */ + if (search_known_sources (source_list, check_default, NULL) == NULL) + e_source_set_property (source, "default", "true"); + g_object_unref (source_group); g_object_unref (goa_account); |