From ae89d959aab24359c730375cff664ac3b44cc953 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Sat, 26 Nov 2005 01:51:39 +0000 Subject: gui/contact-editor/e-contact-editor.c 2005-11-26 Tor Lillqvist * gui/contact-editor/e-contact-editor.c * gui/contact-editor/e-contact-editor-address.c * gui/contact-editor/e-contact-editor-fullname.c * gui/contact-editor/e-contact-editor-im.c * gui/contact-list-editor/e-contact-list-editor.c * gui/merging/eab-contact-merging.c * gui/widgets/e-addressbook-view.c * printing/e-contact-print.c * printing/e-contact-print-style-editor.c: Include e-util-private.h to get redefinition of compile-time pathnames as calls to functions on Windows. Construct the pathnames of files and directories under the installation prefix at run-time to enable install-anywhere on Windows. No effect on functionality on Unix. svn path=/trunk/; revision=30678 --- addressbook/gui/widgets/e-addressbook-view.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'addressbook/gui/widgets') diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 6cf47e2db1..2274d27d54 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -71,6 +71,7 @@ #include "eab-contact-merging.h" #include "e-util/e-error.h" +#include "e-util/e-util-private.h" #include "e-contact-editor.h" #include @@ -422,6 +423,7 @@ eab_view_new (void) GtkWidget *widget = GTK_WIDGET (g_object_new (E_TYPE_AB_VIEW, NULL)); EABView *eav = EAB_VIEW (widget); FilterPart *part; + char *xmlfile; /* create our model */ eav->model = eab_model_new (); @@ -464,7 +466,9 @@ eab_view_new (void) eav->search_context = rule_context_new (); rule_context_add_part_set (eav->search_context, "partset", filter_part_get_type (), rule_context_add_part, rule_context_next_part); - rule_context_load (eav->search_context, SEARCH_RULE_DIR "/addresstypes.xml", ""); + xmlfile = g_build_filename (SEARCH_RULE_DIR, "addresstypes.xml", NULL); + rule_context_load (eav->search_context, xmlfile, ""); + g_free (xmlfile); eav->search_rule = filter_rule_new (); part = rule_context_next_part (eav->search_context, NULL); @@ -537,6 +541,8 @@ init_collection (void) GalViewFactory *factory; ETableSpecification *spec; char *galview; + char *addressbookdir; + char *etspecfile; if (collection == NULL) { collection = gal_view_collection_new(); @@ -544,14 +550,22 @@ init_collection (void) gal_view_collection_set_title (collection, _("Address Book")); galview = gnome_util_prepend_user_home("/.evolution/addressbook/views"); + addressbookdir = g_build_filename (EVOLUTION_GALVIEWSDIR, + "addressbook", + NULL); gal_view_collection_set_storage_directories (collection, - EVOLUTION_GALVIEWSDIR "/addressbook/", + addressbookdir, galview); + g_free(addressbookdir); g_free(galview); spec = e_table_specification_new(); - e_table_specification_load_from_file (spec, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec"); + etspecfile = g_build_filename (EVOLUTION_ETSPECDIR, + "e-addressbook-view.etspec", + NULL); + e_table_specification_load_from_file (spec, etspecfile); + g_free (etspecfile); factory = gal_view_factory_etable_new (spec); g_object_unref (spec); @@ -1280,13 +1294,18 @@ create_table_view (EABView *view) { ETableModel *adapter; GtkWidget *table; + char *etspecfile; adapter = eab_table_adapter_new(view->model); /* Here we create the table. We give it the three pieces of the table we've created, the header, the model, and the initial layout. It does the rest. */ - table = e_table_scrolled_new_from_spec_file (adapter, NULL, EVOLUTION_ETSPECDIR "/e-addressbook-view.etspec", NULL); + etspecfile = g_build_filename (EVOLUTION_ETSPECDIR, + "e-addressbook-view.etspec", + NULL); + table = e_table_scrolled_new_from_spec_file (adapter, NULL, etspecfile, NULL); + g_free (etspecfile); view->object = G_OBJECT(adapter); view->widget = table; -- cgit v1.2.3