aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-config.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-03 03:34:56 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-03 03:37:22 +0800
commit7b4a69edc4a67445ae11c77135772934e4d380a2 (patch)
treef517e23ec707381611252fb3e611139f9b4fa8e5 /mail/em-config.c
parent74f86383fce61cd6712804f39a1baf011d59729a (diff)
downloadgsoc2013-evolution-7b4a69edc4a67445ae11c77135772934e4d380a2.tar.gz
gsoc2013-evolution-7b4a69edc4a67445ae11c77135772934e4d380a2.tar.zst
gsoc2013-evolution-7b4a69edc4a67445ae11c77135772934e4d380a2.zip
EMConfigTargetAccount: Add original_account member.
Rename the existing 'account' member to 'modified_account' and add an 'original_account' member so plugins have direct access to both. Mostly of benefit to the imap-features plugin.
Diffstat (limited to 'mail/em-config.c')
-rw-r--r--mail/em-config.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/mail/em-config.c b/mail/em-config.c
index bc1c0e50d0..e6ed1d5b3b 100644
--- a/mail/em-config.c
+++ b/mail/em-config.c
@@ -83,7 +83,7 @@ em_config_set_target (EConfig *ep,
EMConfig *config = (EMConfig *) ep;
config->priv->account_changed_id = g_signal_connect (
- s->account, "changed",
+ s->modified_account, "changed",
G_CALLBACK(emp_account_changed), ep);
break; }
}
@@ -106,7 +106,7 @@ em_config_target_free (EConfig *ep,
if (config->priv->account_changed_id > 0) {
g_signal_handler_disconnect (
- s->account,
+ s->modified_account,
config->priv->account_changed_id);
config->priv->account_changed_id = 0;
}
@@ -130,7 +130,10 @@ em_config_target_free (EConfig *ep,
case EM_CONFIG_TARGET_ACCOUNT: {
EMConfigTargetAccount *s = (EMConfigTargetAccount *)t;
- g_object_unref (s->account);
+ if (s->original_account != NULL)
+ g_object_unref (s->original_account);
+ if (s->modified_account != NULL)
+ g_object_unref (s->modified_account);
break; }
}
@@ -204,12 +207,24 @@ em_config_target_new_prefs (EMConfig *emp,
}
EMConfigTargetAccount *
-em_config_target_new_account (EMConfig *emp, struct _EAccount *account)
+em_config_target_new_account (EMConfig *emp,
+ EAccount *original_account,
+ EAccount *modified_account)
{
- EMConfigTargetAccount *t = e_config_target_new (&emp->config, EM_CONFIG_TARGET_ACCOUNT, sizeof (*t));
+ EMConfigTargetAccount *t;
- t->account = account;
- g_object_ref (account);
+ t = e_config_target_new (
+ &emp->config, EM_CONFIG_TARGET_ACCOUNT, sizeof (*t));
+
+ if (original_account != NULL)
+ t->original_account = g_object_ref (original_account);
+ else
+ t->original_account = NULL;
+
+ if (modified_account != NULL)
+ t->modified_account = g_object_ref (modified_account);
+ else
+ t->modified_account = NULL;
return t;
}