From: Matthew Barnes Date: Sun, 15 Jul 2012 14:02:34 +0000 (-0400) Subject: online-accounts: Mail sources need to be writable. X-Git-Tag: upstream/3.7.4~660 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=811c82eb68ba53992df82d38816cf716efaa5643;p=platform%2Fupstream%2Fevolution-data-server.git online-accounts: Mail sources need to be writable. Unfortunately there is not a clean separation between GOA-dictated settings and user preferences in mail account ESource triplets, so they all need to be writable and it's up to the client application to defend the settings which must not be changed. --- diff --git a/modules/online-accounts/module-online-accounts.c b/modules/online-accounts/module-online-accounts.c index 137eaf5..27ea615 100644 --- a/modules/online-accounts/module-online-accounts.c +++ b/modules/online-accounts/module-online-accounts.c @@ -428,12 +428,19 @@ online_accounts_config_mail_account (EOnlineAccounts *extension, ESource *source, GoaObject *goa_object) { + EServerSideSource *server_side_source; + online_accounts_config_oauth (extension, source, goa_object); /* XXX Need to defer the network security settings to the * provider-specific module since "imap-use-tls" tells * us neither the port number, nor whether to use IMAP * over SSL versus STARTTLS. The module will know. */ + + /* Clients may change the source by may not remove it. */ + server_side_source = E_SERVER_SIDE_SOURCE (source); + e_server_side_source_set_writable (server_side_source, TRUE); + e_server_side_source_set_removable (server_side_source, FALSE); } static void @@ -443,6 +450,7 @@ online_accounts_config_mail_identity (EOnlineAccounts *extension, { GoaMail *goa_mail; ESourceExtension *source_extension; + EServerSideSource *server_side_source; const gchar *extension_name; goa_mail = goa_object_get_mail (goa_object); @@ -457,6 +465,11 @@ online_accounts_config_mail_identity (EOnlineAccounts *extension, G_BINDING_SYNC_CREATE); g_object_unref (goa_mail); + + /* Clients may change the source by may not remove it. */ + server_side_source = E_SERVER_SIDE_SOURCE (source); + e_server_side_source_set_writable (server_side_source, TRUE); + e_server_side_source_set_removable (server_side_source, FALSE); } static void @@ -464,12 +477,19 @@ online_accounts_config_mail_transport (EOnlineAccounts *extension, ESource *source, GoaObject *goa_object) { + EServerSideSource *server_side_source; + online_accounts_config_oauth (extension, source, goa_object); /* XXX Need to defer the network security settings to the * provider-specific module since "smtp-use-tls" tells * us neither the port number, nor whether to use SMTP * over SSL versus STARTTLS. The module will know. */ + + /* Clients may change the source by may not remove it. */ + server_side_source = E_SERVER_SIDE_SOURCE (source); + e_server_side_source_set_writable (server_side_source, TRUE); + e_server_side_source_set_removable (server_side_source, FALSE); } static void