aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/select-names/e-select-names-text-model.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-07-08 02:37:43 +0800
committerChris Lahey <clahey@src.gnome.org>2000-07-08 02:37:43 +0800
commitcf61f7c4dd6f445be551bea4b55e7902edf4a816 (patch)
tree318ef66d98dbbd186310f71fefcc35cbd9812045 /addressbook/gui/component/select-names/e-select-names-text-model.c
parentfc43959180e0ab748ba68fa4834e6913f2aba74e (diff)
downloadgsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar.gz
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar.bz2
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar.lz
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar.xz
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.tar.zst
gsoc2013-evolution-cf61f7c4dd6f445be551bea4b55e7902edf4a816.zip
Make the entry widgets we create editable.
2000-07-07 Christopher James Lahey <clahey@helixcode.com> * gui/component/select-names/e-select-names-manager.c: Make the entry widgets we create editable. * gui/component/select-names/e-select-names-model.c: Use e_strsplit instead of g_strsplit. Fixed an off by 1 error. * gui/component/select-names/e-select-names-table-model.c: When the model changes, send a model changed signal. * gui/component/select-names/e-select-names-text-model.c: Made changing this work correctly if it's empty. Made change signals propagate properly. Is a bit better about freeing iterators when done. * gui/component/select-names/e-select-names.c: Made the finished lists be in order instead of being sorted. svn path=/trunk/; revision=3955
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.c40
1 files changed, 31 insertions, 9 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 3838e974f6..dd28a50239 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
@@ -125,11 +125,17 @@ e_select_names_text_model_set_text (ETextModel *model, gchar *text)
EIterator *iterator = e_list_get_iterator(e_select_names_model_get_data(source));
e_iterator_reset(iterator);
+ if (!e_iterator_is_valid(iterator)) {
+ gtk_object_unref(GTK_OBJECT(iterator));
+ iterator = NULL;
+ }
e_select_names_model_replace(source,
iterator,
0,
strlen(model->text),
text);
+ if (iterator)
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -141,14 +147,21 @@ e_select_names_text_model_insert (ETextModel *model, gint position, gchar
for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
int this_length = get_length(iterator);
if (position <= this_length) {
- e_select_names_model_insert(source,
- iterator,
- position,
- text);
+ break;
} else {
position -= this_length + 1;
}
}
+ if (!e_iterator_is_valid(iterator)) {
+ gtk_object_unref(GTK_OBJECT(iterator));
+ iterator = NULL;
+ }
+ e_select_names_model_insert(source,
+ iterator,
+ position,
+ text);
+ if (iterator)
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -160,16 +173,22 @@ e_select_names_text_model_insert_length (ETextModel *model, gint position, gchar
for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
int this_length = get_length(iterator);
if (position <= this_length) {
- e_select_names_model_insert_length(source,
- iterator,
- position,
- text,
- length);
break;
} else {
position -= this_length + 1;
}
}
+ if (!e_iterator_is_valid(iterator)) {
+ gtk_object_unref(GTK_OBJECT(iterator));
+ iterator = NULL;
+ }
+ e_select_names_model_insert_length(source,
+ iterator,
+ position,
+ text,
+ length);
+ if (iterator)
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -190,6 +209,8 @@ e_select_names_text_model_delete (ETextModel *model, gint position, gint
position -= this_length + 1;
}
}
+ if (iterator)
+ gtk_object_unref(GTK_OBJECT(iterator));
}
static void
@@ -233,6 +254,7 @@ e_select_names_text_model_model_changed (ESelectNamesModel *source,
*lengthsp = -1;
g_free(E_TEXT_MODEL(model)->text);
E_TEXT_MODEL(model)->text = string;
+ e_text_model_changed(E_TEXT_MODEL(model));
}