aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog6
-rw-r--r--composer/e-msg-composer-hdrs.c41
2 files changed, 18 insertions, 29 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index f54e9ff7bf..d368ec7398 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-09 Frederic Crozat <fcrozat@mandriva.com>
+
+ * e-msg-composer-hdrs.c: (e_msg_composer_hdrs_get_internal),
+ (e_msg_composer_hdrs_get_to), (e_msg_composer_hdrs_get_cc),
+ (e_msg_composer_hdrs_get_bcc): Factorize some code.
+
2006-02-07 Andre Klapper <a9016009@gmx.de>
* mail-composer.error.xml: fixing a patch to again fix 325276.
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c
index 18bd8235ae..5e005269d7 100644
--- a/composer/e-msg-composer-hdrs.c
+++ b/composer/e-msg-composer-hdrs.c
@@ -1446,17 +1446,14 @@ destination_list_to_destv (GList *destinations)
return destv;
}
-EDestination **
-e_msg_composer_hdrs_get_to (EMsgComposerHdrs *hdrs)
+static EDestination **
+e_msg_composer_hdrs_get_internal (EMsgComposerHdrs *hdrs, ENameSelectorEntry *entry)
{
EDestinationStore *destination_store;
GList *destinations;
EDestination **destv = NULL;
- g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
-
- destination_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY (
- hdrs->priv->to.entry));
+ destination_store = e_name_selector_entry_peek_destination_store (entry);
destinations = e_destination_store_list_destinations (destination_store);
destv = destination_list_to_destv (destinations);
@@ -1466,41 +1463,27 @@ e_msg_composer_hdrs_get_to (EMsgComposerHdrs *hdrs)
}
EDestination **
-e_msg_composer_hdrs_get_cc (EMsgComposerHdrs *hdrs)
+e_msg_composer_hdrs_get_to (EMsgComposerHdrs *hdrs)
{
- EDestinationStore *destination_store;
- GList *destinations;
- EDestination **destv = NULL;
-
g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
- destination_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY (
- hdrs->priv->cc.entry));
- destinations = e_destination_store_list_destinations (destination_store);
+ e_msg_composer_hdrs_get_internal (hdrs, E_NAME_SELECTOR_ENTRY (hdrs->priv->to.entry));
+}
- destv = destination_list_to_destv (destinations);
+EDestination **
+e_msg_composer_hdrs_get_cc (EMsgComposerHdrs *hdrs)
+{
+ g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
- g_list_free (destinations);
- return destv;
+ e_msg_composer_hdrs_get_internal (hdrs, E_NAME_SELECTOR_ENTRY (hdrs->priv->cc.entry));
}
EDestination **
e_msg_composer_hdrs_get_bcc (EMsgComposerHdrs *hdrs)
{
- EDestinationStore *destination_store;
- GList *destinations;
- EDestination **destv = NULL;
-
g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL);
- destination_store = e_name_selector_entry_peek_destination_store (E_NAME_SELECTOR_ENTRY (
- hdrs->priv->bcc.entry));
- destinations = e_destination_store_list_destinations (destination_store);
-
- destv = destination_list_to_destv (destinations);
-
- g_list_free (destinations);
- return destv;
+ e_msg_composer_hdrs_get_internal (hdrs, E_NAME_SELECTOR_ENTRY (hdrs->priv->bcc.entry));
}
EDestination **