diff options
author | Dan Vrátil <dvratil@redhat.com> | 2011-10-07 20:40:55 +0800 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2011-10-07 20:40:55 +0800 |
commit | d2232a718dc86dda4182d154a7fdfe1d218229dc (patch) | |
tree | 6dc6c056311e91bc3de202595c43536401af49e4 /addressbook | |
parent | 03a438c3acff6e97146836a84da7236b69cd37fe (diff) | |
download | gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar.gz gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar.bz2 gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar.lz gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar.xz gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.tar.zst gsoc2013-evolution-d2232a718dc86dda4182d154a7fdfe1d218229dc.zip |
Bug #659876 - Make automatic contact address formatting optional
Make behavior introduced in bug #636809 optional by adding checkbox
to Preferences->Contacts.
Diffstat (limited to 'addressbook')
-rw-r--r-- | addressbook/gui/contact-editor/e-contact-editor.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index e2dc21c25c..28b5b636fe 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -2301,17 +2301,35 @@ set_address_label (EContact *contact, EContactAddress *address) { gchar *address_label = NULL; + gboolean format_address; + GConfClient *client; + GConfValue *value; if (!address) { e_contact_set (contact, field, NULL); return; } - address_label = eab_format_address (contact, - (field == E_CONTACT_ADDRESS_LABEL_WORK) ? E_CONTACT_ADDRESS_WORK : - E_CONTACT_ADDRESS_HOME); - if (!address_label) { + client = gconf_client_get_default (); + value = gconf_client_get (client, + "/apps/evolution/addressbook/display/address_formatting", NULL); + g_object_unref (client); + + if (value) { + format_address = gconf_value_get_bool (value); + gconf_value_free (value); + } else { + format_address = TRUE; + } + + if (format_address) { + address_label = eab_format_address (contact, + (field == E_CONTACT_ADDRESS_LABEL_WORK) ? E_CONTACT_ADDRESS_WORK : + E_CONTACT_ADDRESS_HOME); + } + + if (!format_address || !address_label) { address_label = append_to_address_label ( address_label, address->street, TRUE); address_label = append_to_address_label ( |