From 661cc2d0ef7f97a064543032b088d5092c36b4cb Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 7 Jul 2000 16:14:27 +0000 Subject: Since ELDAPServer->port is a char *, allocate a string with the number 389 2000-07-07 Christopher James Lahey * gui/component/addressbook.c (new_server_cb): Since ELDAPServer->port is a char *, allocate a string with the number 389 contained. * gui/component/addressbook.c: Make the select names test test the new code instead of the old way of getting to an ESelectNames dialog. * gui/component/select-names/e-select-names-manager.c: Coded storing the model for each section, creating an entry and returning it, and for activating the dialog. Wrote a bit of the get_cards code, but not all of it. * gui/component/select-names/e-select-names-model.c, gui/component/select-names/e-select-names-model.h: Coded all of the code needed to make ESelectNamesTextModel work (it doesn't yet, but all the code should be there.) Removed E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL. * gui/component/select-names/e-select-names-table-model.c, gui/component/select-names/e-select-names-text-model.c: Changed these to compensate for removal of E_SELECT_NAMES_MODEL_DATA_TYPE_SEPARATION_MATERIAL. * gui/component/select-names/e-select-names-table-model.h, gui/component/select-names/e-select-names-text-model.h: Fixed some silly typos. * gui/component/select-names/e-select-names.c, gui/component/select-names/e-select-names.h: Added a parameter to add_section that lets you specify the source ESelectNamesModel. svn path=/trunk/; revision=3948 --- .../gui/component/select-names/e-select-names-text-model.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'addressbook/gui/component/select-names/e-select-names-text-model.c') diff --git a/addressbook/gui/component/select-names/e-select-names-text-model.c b/addressbook/gui/component/select-names/e-select-names-text-model.c index abbbae3321..3838e974f6 100644 --- a/addressbook/gui/component/select-names/e-select-names-text-model.c +++ b/addressbook/gui/component/select-names/e-select-names-text-model.c @@ -146,7 +146,7 @@ e_select_names_text_model_insert (ETextModel *model, gint position, gchar position, text); } else { - position -= this_length; + position -= this_length + 1; } } } @@ -165,8 +165,9 @@ e_select_names_text_model_insert_length (ETextModel *model, gint position, gchar position, text, length); + break; } else { - position -= this_length; + position -= this_length + 1; } } } @@ -184,8 +185,9 @@ e_select_names_text_model_delete (ETextModel *model, gint position, gint iterator, position, length); + break; } else { - position -= this_length; + position -= this_length + 1; } } } @@ -204,8 +206,10 @@ e_select_names_text_model_model_changed (ESelectNamesModel *source, for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) { const ESelectNamesModelData *data = e_iterator_get(iterator); length += strlen(data->string); + length ++; length_count++; } + length --; g_free(model->lengths); model->lengths = g_new(int, length_count + 1); @@ -221,8 +225,10 @@ e_select_names_text_model_model_changed (ESelectNamesModel *source, strcpy(stringp, data->string); this_length = strlen(stringp); stringp += this_length; + *(stringp++) = ','; *(lengthsp++) = this_length; } + stringp --; *stringp = 0; *lengthsp = -1; g_free(E_TEXT_MODEL(model)->text); -- cgit