From 3e00d395673af32a14764aed2a27f4bd7e32cbc6 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Sun, 7 May 2000 22:04:37 +0000 Subject: don't create a new ebook. instead, unload the current uri (if there is * gui/component/addressbook.c (set_prop): don't create a new ebook. instead, unload the current uri (if there is one) and load the new one. svn path=/trunk/; revision=2885 --- addressbook/gui/component/addressbook.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'addressbook/gui/component') diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c index dc5e591a44..883982d500 100644 --- a/addressbook/gui/component/addressbook.c +++ b/addressbook/gui/component/addressbook.c @@ -509,23 +509,19 @@ set_prop (BonoboPropertyBag *bag, { AddressbookView *view = user_data; - EBook *book; char *uri_file; char *uri_data; switch (arg_id) { case PROPERTY_FOLDER_URI_IDX: - view->uri = g_strdup(BONOBO_ARG_GET_STRING (arg)); - - book = e_book_new (); - - if (!book) { - printf ("%s: %s(): Couldn't create EBook, bailing.\n", - __FILE__, - __FUNCTION__); - return; + if (view->uri) { + /* we've already had a uri set on this view, so unload it */ + e_book_unload_uri (view->book); + g_free (view->uri); } + + view->uri = g_strdup(BONOBO_ARG_GET_STRING (arg)); uri_file = g_concat_dir_and_file(view->uri + 7, "uri"); -- cgit v1.2.3