aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog5
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c41
2 files changed, 27 insertions, 19 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6fe117daa8..0c9c58f467 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,8 @@
+2000-07-10 Peter Williams <peterw@curious-george.helixcode.com>
+
+ * gui/component/select-names/e-select-names-model.c: (Clahey's fix)
+ Make multiple addresses be concatenated correctly.
+
2000-07-09 Christopher James Lahey <clahey@helixcode.com>
* gui/component/addressbook.c,
diff --git a/addressbook/gui/component/select-names/e-select-names-model.c b/addressbook/gui/component/select-names/e-select-names-model.c
index 2281339a47..32f2a85a56 100644
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-model.c
@@ -284,26 +284,29 @@ e_select_names_model_insert (ESelectNamesModel *model,
gchar *temp = g_strdup_printf("%.*s%s%s", index, node->string, strings[0], node->string + index);
g_free(node->string);
node->string = temp;
- }
- for (i = 1; strings[i]; i++) {
- ESelectNamesModelData *node = (void *) e_iterator_get(iterator);
- gchar *temp = g_strdup_printf("%.*s", index, node->string);
- gchar *temp2 = g_strdup_printf("%s%s", strings[0], node->string + index);
+ index += strlen(strings[0]);
- g_free(node->string);
- node->type = E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS;
- node->string = temp;
- if (node->card)
- gtk_object_unref(GTK_OBJECT(node->card));
- node->card = NULL;
-
- node = g_new(ESelectNamesModelData, 1);
- node->type = E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS;
- node->card = NULL;
- node->string = temp2;
- e_iterator_insert(iterator, node, 0);
- g_free(node->string);
- g_free(node);
+ for (i = 1; strings[i]; i++) {
+ ESelectNamesModelData *node = (void *) e_iterator_get(iterator);
+ gchar *temp = g_strdup_printf("%.*s", index, node->string);
+ gchar *temp2 = g_strdup_printf("%s%s", strings[i], node->string + index);
+
+ g_free(node->string);
+ node->type = E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS;
+ node->string = temp;
+ if (node->card)
+ gtk_object_unref(GTK_OBJECT(node->card));
+ node->card = NULL;
+
+ node = g_new(ESelectNamesModelData, 1);
+ node->type = E_SELECT_NAMES_MODEL_DATA_TYPE_STRING_ADDRESS;
+ node->card = NULL;
+ node->string = temp2;
+ e_iterator_insert(iterator, node, 0);
+ index = strlen(strings[i]);
+ g_free(node->string);
+ g_free(node);
+ }
}
e_select_names_model_changed(model);
gtk_object_unref(GTK_OBJECT(iterator));