diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-07-09 09:24:53 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-07-09 09:24:53 +0800 |
commit | a451a634c20ffb820fd07700b9bb88fbd29df2b9 (patch) | |
tree | eaaa372f989cdb74eb7685b3f80cb10d08c88ae0 /addressbook/gui/component/select-names/e-select-names-text-model.c | |
parent | 1150b8d1b3f6691ea50eeb768216838311f7b7c6 (diff) | |
download | gsoc2013-evolution-a451a634c20ffb820fd07700b9bb88fbd29df2b9.tar.gz gsoc2013-evolution-a451a634c20ffb820fd07700b9bb88fbd29df2b9.tar.zst gsoc2013-evolution-a451a634c20ffb820fd07700b9bb88fbd29df2b9.zip |
Include e-select-names-factory.h.
2000-07-08 Christopher James Lahey <clahey@helixcode.com>
* gui/component/addressbook-factory.c: Include
e-select-names-factory.h.
* gui/component/select-names/e-select-names-model.c: Handle a NULL
iterator properly in the replace function.
* gui/component/select-names/e-select-names-table-model.c: Fill in
info properly in the value_at function.
* gui/component/select-names/e-select-names-text-model.c: Don't
strlen a NULL text object.
* gui/component/select-names/e-select-names.c: Close if the person
hits ok or cancel (doesn't yet actually undo changes if Cancel is
hit.) Handle removing addresses when they're double clicked on.
* gui/component/select-names/select-names.glade,
gui/component/select-names/select-names.glade.h: Hid some unused
fields and changed the text at the top of the dialog.
svn path=/trunk/; revision=3989
Diffstat (limited to 'addressbook/gui/component/select-names/e-select-names-text-model.c')
-rw-r--r-- | addressbook/gui/component/select-names/e-select-names-text-model.c | 15 |
1 files changed, 11 insertions, 4 deletions
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 dd28a50239..7fa7b87892 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 @@ -123,6 +123,10 @@ e_select_names_text_model_set_text (ETextModel *model, gchar *text) { ESelectNamesModel *source = E_SELECT_NAMES_TEXT_MODEL(model)->source; EIterator *iterator = e_list_get_iterator(e_select_names_model_get_data(source)); + int length = 0; + if (model->text) { + length = strlen(model->text); + } e_iterator_reset(iterator); if (!e_iterator_is_valid(iterator)) { @@ -132,7 +136,7 @@ e_select_names_text_model_set_text (ETextModel *model, gchar *text) e_select_names_model_replace(source, iterator, 0, - strlen(model->text), + length, text); if (iterator) gtk_object_unref(GTK_OBJECT(iterator)); @@ -230,7 +234,8 @@ e_select_names_text_model_model_changed (ESelectNamesModel *source, length ++; length_count++; } - length --; + if (length > 0) + length --; g_free(model->lengths); model->lengths = g_new(int, length_count + 1); @@ -249,8 +254,10 @@ e_select_names_text_model_model_changed (ESelectNamesModel *source, *(stringp++) = ','; *(lengthsp++) = this_length; } - stringp --; - *stringp = 0; + if (stringp != string) { + stringp --; + *stringp = 0; + } *lengthsp = -1; g_free(E_TEXT_MODEL(model)->text); E_TEXT_MODEL(model)->text = string; |