aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Crozat <fcrozat@src.gnome.org>2006-02-10 01:35:43 +0800
committerFrédéric Crozat <fcrozat@src.gnome.org>2006-02-10 01:35:43 +0800
commit02f7d08e8af85a108e98935aa325b0e3ad6c38e0 (patch)
tree290dd6cd597789012b8e9b1d3be85faeb0f87b67
parent6469a2db0e6531a766e8edc23961eb43cb2d679f (diff)
downloadgsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar.gz
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar.bz2
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar.lz
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar.xz
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.tar.zst
gsoc2013-evolution-02f7d08e8af85a108e98935aa325b0e3ad6c38e0.zip
Factorize some code.
* 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. svn path=/trunk/; revision=31465
-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 **