[evolution] Bug #657310 - Crash when editing transport-only accounts



commit af690e79a1c7ec7caa2f9c661bd1bd3f709a3e30
Author: Milan Crha <mcrha redhat com>
Date:   Fri Aug 26 10:30:50 2011 +0200

    Bug #657310 - Crash when editing transport-only accounts

 mail/e-mail-store.c      |   10 +++++++++-
 mail/em-account-editor.c |    8 ++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c
index 873c47d..7c79e1c 100644
--- a/mail/e-mail-store.c
+++ b/mail/e-mail-store.c
@@ -275,12 +275,17 @@ e_mail_store_add_by_account (EMailSession *session,
 	CamelService *service = NULL;
 	CamelProvider *provider;
 	CamelURL *url;
-	gboolean skip;
+	gboolean skip, transport_only;
 	GError *error = NULL;
 
 	g_return_val_if_fail (E_IS_MAIL_SESSION (session), NULL);
 	g_return_val_if_fail (E_IS_ACCOUNT (account), NULL);
 
+	/* check whether it's transport-only accounts */
+	transport_only = !account->source || !account->source->url || !*account->source->url;
+	if (transport_only)
+		goto handle_transport;
+		
 	/* Load the service, but don't connect.  Check its provider,
 	 * and if this belongs in the folder tree model, add it. */
 
@@ -326,6 +331,9 @@ handle_transport:
 		}
 	}
 
+	if (transport_only)
+		return NULL;
+
 	if (!CAMEL_IS_STORE (service))
 		goto fail;
 
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index d84eb65..8c184ae 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -3196,7 +3196,7 @@ emae_defaults_page (EConfig *ec,
 		priv->trash_folder_button, "sensitive",
 		G_BINDING_SYNC_CREATE);
 
-	pspec = g_object_class_find_property (
+	pspec = !settings ? NULL : g_object_class_find_property (
 		G_OBJECT_GET_CLASS (settings), "use-real-trash-path");
 
 	if (pspec != NULL)
@@ -3206,7 +3206,7 @@ emae_defaults_page (EConfig *ec,
 			G_BINDING_BIDIRECTIONAL |
 			G_BINDING_SYNC_CREATE);
 
-	pspec = g_object_class_find_property (
+	pspec = !settings ? NULL : g_object_class_find_property (
 		G_OBJECT_GET_CLASS (settings), "real-trash-path");
 
 	if (pspec != NULL) {
@@ -3241,7 +3241,7 @@ emae_defaults_page (EConfig *ec,
 		priv->junk_folder_button, "sensitive",
 		G_BINDING_SYNC_CREATE);
 
-	pspec = g_object_class_find_property (
+	pspec = !settings ? NULL : g_object_class_find_property (
 		G_OBJECT_GET_CLASS (settings), "use-real-junk-path");
 
 	if (pspec != NULL)
@@ -3251,7 +3251,7 @@ emae_defaults_page (EConfig *ec,
 			G_BINDING_BIDIRECTIONAL |
 			G_BINDING_SYNC_CREATE);
 
-	pspec = g_object_class_find_property (
+	pspec = !settings ? NULL : g_object_class_find_property (
 		G_OBJECT_GET_CLASS (settings), "real-junk-path");
 
 	if (pspec != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]