rpms/evolution/F-10 evolution-2.24.2-broken-account-uris.patch, NONE, 1.1 evolution.spec, 1.362, 1.363

Matthew Barnes mbarnes at fedoraproject.org
Tue Dec 9 17:30:52 UTC 2008


Author: mbarnes

Update of /cvs/pkgs/rpms/evolution/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8529

Modified Files:
	evolution.spec 
Added Files:
	evolution-2.24.2-broken-account-uris.patch 
Log Message:

* Tue Dec 09 2008 Matthew Barnes <mbarnes at redhat.com> - 2.24.2-2.fc10
- Add patch for GNOME bug #552583 (fix account URI comparisons).


evolution-2.24.2-broken-account-uris.patch:

--- NEW FILE evolution-2.24.2-broken-account-uris.patch ---
diff -up evolution-2.24.2/mail/mail-config.c.broken-account-uris evolution-2.24.2/mail/mail-config.c
--- evolution-2.24.2/mail/mail-config.c.broken-account-uris	2008-11-19 23:07:24.000000000 -0500
+++ evolution-2.24.2/mail/mail-config.c	2008-12-09 11:27:34.000000000 -0500
@@ -778,53 +778,64 @@ mail_config_get_account_by_uid (const ch
 	return (EAccount *) e_account_list_find (config->accounts, E_ACCOUNT_FIND_UID, uid);
 }
 
+static gboolean
+mail_config_account_url_equal (const CamelURL *u1,
+                               const CamelURL *u2)
+{
+	/* For the purpose of matching a URL to an EAccount, only compare
+	 * the protocol, user, host and port and disregard the rest. */
+
+	if (g_strcmp0 (u1->protocol, u2->protocol) != 0)
+		return FALSE;
+
+	if (g_strcmp0 (u1->user, u2->user) != 0)
+		return FALSE;
+
+	if (g_strcmp0 (u1->host, u2->host) != 0)
+		return FALSE;
+
+	return (u1->port == u2->port);
+}
+
 EAccount *
 mail_config_get_account_by_source_url (const char *source_url)
 {
 	EAccount *account = NULL;
 	EIterator *iter;
+	CamelURL *url;
 
 	g_return_val_if_fail (source_url != NULL, NULL);
 
+	url = camel_url_new (source_url, NULL);
+	g_return_val_if_fail (url != NULL, NULL);
+
 	iter = e_list_get_iterator ((EList *) config->accounts);
-	while (e_iterator_is_valid (iter)) {
-		CamelURL *url;
-		gchar *string;
+	while (account == NULL && e_iterator_is_valid (iter)) {
+		CamelURL *account_url;
 
 		account = (EAccount *) e_iterator_get (iter);
 
 		e_iterator_next (iter);
 
-		if (account->source == NULL)
-			continue;
-
-		else if (account->source->url == NULL)
-			continue;
-
-		else if (*account->source->url == '\0')
+		if ( !account || (account->source == NULL) || 
+			(account->source->url == NULL) || (*account->source->url == '\0')) {
+			account = NULL;
 			continue;
+		}
 
-		url = camel_url_new (account->source->url, NULL);
-		if (url == NULL)
+		account_url = camel_url_new (account->source->url, NULL);
+		if (account_url == NULL)
 			continue;
 
-		/* Simplify the account URL for comparison. */
-		string = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
-		if (string == NULL || strcmp (string, source_url) != 0)
+		if (!mail_config_account_url_equal (url, account_url))
 			account = NULL;  /* not a match */
 
-		camel_url_free (url);
-		g_free (string);
-
-		if (account != NULL) {
-			g_object_unref (iter);
-			return account;
-		}
+		camel_url_free (account_url);
 	}
 
 	g_object_unref (iter);
 
-	return NULL;
+	return account;
 }
 
 EAccount *
@@ -832,48 +843,40 @@ mail_config_get_account_by_transport_url
 {
 	EAccount *account = NULL;
 	EIterator *iter;
+	CamelURL *url;
 
 	g_return_val_if_fail (transport_url != NULL, NULL);
 
+	url = camel_url_new (transport_url, NULL);
+	g_return_val_if_fail (url != NULL, NULL);
+
 	iter = e_list_get_iterator ((EList *) config->accounts);
-	while (e_iterator_is_valid (iter)) {
-		CamelURL *url;
-		gchar *string;
+	while (account == NULL && e_iterator_is_valid (iter)) {
+		CamelURL *account_url;
 
 		account = (EAccount *) e_iterator_get (iter);
 
 		e_iterator_next (iter);
 
-		if (account->transport == NULL)
-			continue;
-
-		else if (account->transport->url == NULL)
-			continue;
-
-		else if (*account->transport->url == '\0')
-			continue;
+		if ( !account || (account->transport == NULL) || 
+			(account->transport->url == NULL) || (*account->transport->url == '\0')) {
+				account = NULL;
+				continue;
+		}
 
-		url = camel_url_new (account->transport->url, NULL);
-		if (url == NULL)
+		account_url = camel_url_new (account->transport->url, NULL);
+		if (account_url == NULL)
 			continue;
 
-		/* Simplify the account URL for comparison. */
-		string = camel_url_to_string (url, CAMEL_URL_HIDE_ALL);
-		if (string == NULL || strcmp (string, transport_url) != 0)
+		if (!mail_config_account_url_equal (url, account_url))
 			account = NULL;  /* not a match */
 
 		camel_url_free (url);
-		g_free (string);
-
-		if (account != NULL) {
-			g_object_unref (iter);
-			return account;
-		}
 	}
 
 	g_object_unref (iter);
 
-	return NULL;
+	return account;
 }
 
 int


Index: evolution.spec
===================================================================
RCS file: /cvs/pkgs/rpms/evolution/F-10/evolution.spec,v
retrieving revision 1.362
retrieving revision 1.363
diff -u -r1.362 -r1.363
--- evolution.spec	24 Nov 2008 15:07:31 -0000	1.362
+++ evolution.spec	9 Dec 2008 17:30:21 -0000	1.363
@@ -45,7 +45,7 @@
 
 Name: evolution
 Version: 2.24.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2 and GFDL
 Group: Applications/Productivity
 Summary: Mail and calendar client for GNOME
@@ -80,6 +80,9 @@
 # Don't ship broken plugins as stable
 Patch15: evolution-2.23.4-experimental-plugins.patch
 
+# GNOME bug #552583
+Patch16: evolution-2.24.2-broken-account-uris.patch
+
 ## Dependencies ###
 
 Requires(post): GConf2
@@ -232,6 +235,7 @@
 %patch13 -p1 -b .no-gnome-common
 %patch14 -p1 -b .im-context-reset
 %patch15 -p1 -b .experimental-plugins
+%patch16 -p1 -b .broken-account-uris
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -696,6 +700,9 @@
 %{_libexecdir}/evolution/%{evo_major}/evolution-addressbook-clean
 
 %changelog
+* Tue Dec 09 2008 Matthew Barnes <mbarnes at redhat.com> - 2.24.2-2.fc10
+- Add patch for GNOME bug #552583 (fix account URI comparisons).
+
 * Mon Nov 24 2008 Matthew Barnes <mbarnes at redhat.com> - 2.24.2-1.fc10
 - Update to 2.24.2
 




More information about the fedora-extras-commits mailing list