aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorDan Vrátil <dvratil@redhat.com>2011-10-07 20:44:05 +0800
committerDan Vrátil <dvratil@redhat.com>2011-10-07 20:44:05 +0800
commit3218a0ae85011e050b678043942136cfc6746c4c (patch)
tree379b2df6ea137bf4e6c9c57b86f6b29a6b16ad5f /addressbook/gui
parentf211a81214948f80b0403208197af5718b7ac11b (diff)
downloadgsoc2013-evolution-3218a0ae85011e050b678043942136cfc6746c4c.tar.gz
gsoc2013-evolution-3218a0ae85011e050b678043942136cfc6746c4c.tar.zst
gsoc2013-evolution-3218a0ae85011e050b678043942136cfc6746c4c.zip
Bug #659876 - Make automatic contact address formatting optional
Added only GConf option to schema, GUI option will be available in Evolution 3.4.
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/contact-editor/e-contact-editor.c26
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 6ce9524afc..19e247f04c 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 (