[evolution-data-server/gnome-3-22] Bug 774103 - GOA mail account doesn't inherit GoaMail::name
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-22] Bug 774103 - GOA mail account doesn't inherit GoaMail::name
- Date: Thu, 10 Nov 2016 17:52:02 +0000 (UTC)
commit f58cd1a291a63ecba145ac91f1793b9fa9ca75a7
Author: Milan Crha <mcrha redhat com>
Date: Thu Nov 10 18:46:54 2016 +0100
Bug 774103 - GOA mail account doesn't inherit GoaMail::name
.../module-gnome-online-accounts.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/modules/gnome-online-accounts/module-gnome-online-accounts.c
b/modules/gnome-online-accounts/module-gnome-online-accounts.c
index 929c0e4..f74dc75 100644
--- a/modules/gnome-online-accounts/module-gnome-online-accounts.c
+++ b/modules/gnome-online-accounts/module-gnome-online-accounts.c
@@ -649,8 +649,8 @@ gnome_online_accounts_config_mail_identity (EGnomeOnlineAccounts *extension,
GoaObject *goa_object)
{
GoaMail *goa_mail;
- ESourceExtension *source_extension;
EServerSideSource *server_side_source;
+ ESourceMailIdentity *mail_identity;
ESourceMailSubmission *mail_submission;
ESourceMailComposition *mail_composition;
const gchar *extension_name;
@@ -662,11 +662,24 @@ gnome_online_accounts_config_mail_identity (EGnomeOnlineAccounts *extension,
return;
extension_name = E_SOURCE_EXTENSION_MAIL_IDENTITY;
- source_extension = e_source_get_extension (source, extension_name);
+ mail_identity = e_source_get_extension (source, extension_name);
+
+ tmp = e_source_mail_identity_dup_address (mail_identity);
+ if (!tmp || !*tmp) {
+ /* Set the Name only if the mail is not set yet, because users can change the Name,
+ even to an empty string, but the email is fixed with the one from GoaMail.
+ */
+ g_free (tmp);
+
+ tmp = goa_mail_dup_name (goa_mail);
+ if (tmp && *tmp)
+ e_source_mail_identity_set_name (mail_identity, tmp);
+ }
+ g_free (tmp);
e_binding_bind_property (
goa_mail, "email-address",
- source_extension, "address",
+ mail_identity, "address",
G_BINDING_SYNC_CREATE);
g_object_unref (goa_mail);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]