From 36c3c3cf936008c0c0f8b85605f4970f395b3fb7 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Sun, 9 Jul 2000 16:03:39 +0000 Subject: Added a field that gives the name if it exists and the company name 2000-07-09 Christopher James Lahey * backend/ebook/e-card-simple.c, backend/ebook/e-card-simple.h: Added a field that gives the name if it exists and the company name otherwise. * gui/component/e-addressbook-model.c: Formatting changes. * gui/component/select-names/e-select-names-table-model.c: Added stripping of names and display of company name if name doesn't exist. * gui/component/select-names/e-select-names.c: Fixed up the display so that we display both name and email address. svn path=/trunk/; revision=4020 --- .../gui/component/select-names/e-select-names-table-model.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names-table-model.c') diff --git a/addressbook/gui/component/select-names/e-select-names-table-model.c b/addressbook/gui/component/select-names/e-select-names-table-model.c index 2e33fdfe85..0c56606c31 100644 --- a/addressbook/gui/component/select-names/e-select-names-table-model.c +++ b/addressbook/gui/component/select-names/e-select-names-table-model.c @@ -12,6 +12,7 @@ #include #include +#include "e-util/e-util.h" #include "e-select-names-table-model.h" #include "addressbook/backend/ebook/e-card-simple.h" @@ -122,14 +123,21 @@ fill_in_info (ESelectNamesTableModel *model) case E_SELECT_NAMES_MODEL_DATA_TYPE_CARD: { ECardSimple *simple = e_card_simple_new(data->card); model->data[count].name = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_FULL_NAME); + if ((model->data[count].name == 0) || *model->data[count].name == 0) { + model->data[count].name = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_ORG); + } + if (model->data[count].name == 0) + model->data[count].name = g_strdup(""); model->data[count].email = e_card_simple_get(simple, E_CARD_SIMPLE_FIELD_EMAIL); + if (model->data[count].email == 0) + model->data[count].email = g_strdup(""); gtk_object_unref(GTK_OBJECT(simple)); count ++; break; } case E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS: - model->data[count].name = g_strdup(data->string); - model->data[count].email = g_strdup(data->string); + model->data[count].name = e_strdup_strip(data->string); + model->data[count].email = e_strdup_strip(data->string); count ++; break; } -- cgit v1.2.3