aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-09-05 22:43:58 +0800
committerMilan Crha <mcrha@redhat.com>2012-09-05 22:43:58 +0800
commite18f1b87095c60977c4c0e0a279e7ee78a049dc6 (patch)
treee3f16f2372966ae6081c3159f0caf8cd8835fda6
parent511acab89a83114aad35e9c6f76a8f284907dab9 (diff)
downloadgsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar.gz
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar.bz2
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar.lz
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar.xz
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.tar.zst
gsoc2013-evolution-e18f1b87095c60977c4c0e0a279e7ee78a049dc6.zip
Composer could start with empty From
-rw-r--r--composer/e-composer-from-header.c39
-rw-r--r--composer/e-msg-composer.c9
2 files changed, 45 insertions, 3 deletions
diff --git a/composer/e-composer-from-header.c b/composer/e-composer-from-header.c
index a844ca3d6a..ceecd68b87 100644
--- a/composer/e-composer-from-header.c
+++ b/composer/e-composer-from-header.c
@@ -107,7 +107,44 @@ e_composer_from_header_set_active_id (EComposerFromHeader *header,
g_return_if_fail (E_IS_COMPOSER_FROM_HEADER (header));
+ if (!active_id)
+ return;
+
combo_box = GTK_COMBO_BOX (E_COMPOSER_HEADER (header)->input_widget);
- gtk_combo_box_set_active_id (combo_box, active_id);
+ if (!gtk_combo_box_set_active_id (combo_box, active_id) && active_id && *active_id) {
+ ESourceRegistry *registry;
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ gint id_column;
+
+ registry = e_composer_header_get_registry (E_COMPOSER_HEADER (header));
+ id_column = gtk_combo_box_get_id_column (combo_box);
+ model = gtk_combo_box_get_model (combo_box);
+
+ if (gtk_tree_model_get_iter_first (model, &iter)) {
+ do {
+ gchar *identity_uid = NULL;
+
+ gtk_tree_model_get (model, &iter, id_column, &identity_uid, -1);
+
+ if (identity_uid) {
+ ESource *source;
+
+ source = e_source_registry_ref_source (registry, identity_uid);
+ if (source) {
+ if (g_strcmp0 (e_source_get_parent (source), active_id) == 0) {
+ g_object_unref (source);
+ gtk_combo_box_set_active_id (combo_box, identity_uid);
+ g_free (identity_uid);
+ break;
+ }
+ g_object_unref (source);
+ }
+
+ g_free (identity_uid);
+ }
+ } while (gtk_tree_model_iter_next (model, &iter));
+ }
+ }
}
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 0fc5f2f475..777b7e7423 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -575,8 +575,8 @@ build_message_headers (EMsgComposer *composer,
camel_mime_message_set_from (message, addr);
g_object_unref (addr);
- /* X-Evolution-Account */
- header_name = "X-Evolution-Account";
+ /* X-Evolution-Identity */
+ header_name = "X-Evolution-Identity";
camel_medium_set_header (medium, header_name, uid);
/* X-Evolution-Fcc */
@@ -3108,6 +3108,11 @@ e_msg_composer_new_with_message (EShell *shell,
/* Restore the mail identity preference. */
identity_uid = (gchar *) camel_medium_get_header (
CAMEL_MEDIUM (message), "X-Evolution-Identity");
+ if (!identity_uid) {
+ /* for backward compatibility */
+ identity_uid = (gchar *) camel_medium_get_header (
+ CAMEL_MEDIUM (message), "X-Evolution-Account");
+ }
if (identity_uid != NULL) {
identity_uid = g_strstrip (g_strdup (identity_uid));
source = e_source_registry_ref_source (registry, identity_uid);