[evolution-patches] patch for addressbook bug #40954



Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/ChangeLog,v
retrieving revision 1.1383
diff -u -r1.1383 ChangeLog
--- ChangeLog	15 Apr 2003 18:51:05 -0000	1.1383
+++ ChangeLog	16 Apr 2003 22:28:15 -0000
@@ -1,3 +1,14 @@
+2003-04-16  Chris Toshok  <toshok ximian com>
+
+	[ fixes bug #40954 ]
+	* backend/pas/pas-backend-file.c (pas_backend_file_dispose): guard
+	against NULL bf->priv->summary (happens if the initial load_uri
+	failed).
+	(pas_backend_file_load_uri): always set bf->priv->uri, since it's
+	used in _get_uri, which is called when the backend goes away.
+	This only happened before if you tried to load a folder that
+	didn't exist.
+
 2003-04-15  Chris Toshok  <toshok ximian com>
 
 	[ fixes #41252 ]
Index: backend/pas/pas-backend-file.c
===================================================================
RCS file: /cvs/gnome/evolution/addressbook/backend/pas/pas-backend-file.c,v
retrieving revision 1.131
diff -u -r1.131 pas-backend-file.c
--- backend/pas/pas-backend-file.c	11 Mar 2003 01:10:44 -0000	1.131
+++ backend/pas/pas-backend-file.c	16 Apr 2003 22:28:15 -0000
@@ -395,8 +395,7 @@
 	while (db_error == 0) {
 
 		/* don't include the version in the list of cards */
-		if (id_dbt.size != file_version_name_len+1
-		    || strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
+		if (strcmp (id_dbt.data, PAS_BACKEND_FILE_VERSION_NAME)) {
 			char *vcard_string = vcard_dbt.data;
 
 			/* check if the vcard matches the search sexp */
@@ -1378,6 +1377,9 @@
 	struct stat sb;
 	char *summary_filename;
 
+	g_free(bf->priv->uri);
+	bf->priv->uri = g_strdup (uri);
+
 	db_version (&major, &minor, &patch);
 
 	if (major != 3 ||
@@ -1450,9 +1452,6 @@
 		return GNOME_Evolution_Addressbook_BookListener_OtherError;
 	}
 
-	g_free(bf->priv->uri);
-	bf->priv->uri = g_strdup (uri);
-
 	g_free (bf->priv->filename);
 	bf->priv->filename = filename;
 
@@ -1536,7 +1535,8 @@
 
 	if (bf->priv) {
 		g_object_unref(bf->priv->book_views);
-		g_object_unref(bf->priv->summary);
+		if (bf->priv->summary)
+			g_object_unref(bf->priv->summary);
 		g_free (bf->priv->uri);
 		g_free (bf->priv->filename);
 


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