[Evolution-hackers] e_book_get_default_addressbook() partial fix


Attached is a small patch to change e_book_get_default_addressbook() to
load $HOME/.evolution/.../OnThisComputer/Personal/ with the new ESource

Obviously this isn't the best fix as if someone renames the address book
it breaks, but it works for now and is better than loading the old Evo1
address book in ~/evolution/local/Contacts/ :)

Is this okay to commit for now?

Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF
Index: addressbook/libebook/e-book.c
RCS file: /cvs/gnome/evolution-data-server/addressbook/libebook/e-book.c,v
retrieving revision 1.6
diff -u -r1.6 e-book.c
--- addressbook/libebook/e-book.c	27 Nov 2003 02:29:02 -0000	1.6
+++ addressbook/libebook/e-book.c	28 Nov 2003 11:29:53 -0000
@@ -1947,18 +1947,24 @@
 	   this should really use properties on the ESource's that
 	   represent the addressbooks we have available. */
 	char *path, *uri;
+	ESourceGroup *group;
+	ESource *source;
 	gboolean rv;
 	*book = e_book_new ();
 	path = g_build_filename (g_get_home_dir (),
-				 "evolution/local/Contacts",
+				 ".evolution/addressbook/local/OnThisComputer",
 	uri = g_strdup_printf ("file://%s", path);
 	g_free (path);
-	rv = e_book_load_uri (*book, uri, FALSE, error);
+	group  = e_source_group_new ("On This Computer", uri);
+	source = e_source_new ("Personal", "Personal");
+	e_source_set_group (source, group);
+	rv = e_book_load_source (*book, source, FALSE, error);
 	g_free (uri);
 	if (!rv) {

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