aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/select-names/e-select-names-manager.c9
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.c20
-rw-r--r--addressbook/gui/component/select-names/e-select-names-model.h11
3 files changed, 31 insertions, 9 deletions
diff --git a/addressbook/gui/component/select-names/e-select-names-manager.c b/addressbook/gui/component/select-names/e-select-names-manager.c
index ead51d8dca..b255942d08 100644
--- a/addressbook/gui/component/select-names/e-select-names-manager.c
+++ b/addressbook/gui/component/select-names/e-select-names-manager.c
@@ -425,13 +425,13 @@ e_select_names_clicked(ESelectNames *dialog, gint button, ESelectNamesManager *m
for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
ESelectNamesManagerSection *section = (void *) e_iterator_get(iterator);
ESelectNamesModel *source = e_select_names_get_source(dialog, section->id);
- if (section->model)
- gtk_object_unref(GTK_OBJECT(section->model));
- section->model = source;
- /* Don't ref because get_source returns a conceptual ref_count of 1. */
+ e_select_names_model_overwrite_copy (section->model, source);
+ gtk_object_unref (GTK_OBJECT (source));
+
}
gtk_object_unref(GTK_OBJECT(iterator));
+#if 0
list = manager->entries;
iterator = e_list_get_iterator(list);
for (e_iterator_reset(iterator); e_iterator_is_valid(iterator); e_iterator_next(iterator)) {
@@ -449,6 +449,7 @@ e_select_names_clicked(ESelectNames *dialog, gint button, ESelectNamesManager *m
}
}
gtk_object_unref(GTK_OBJECT(iterator));
+#endif
break;
}
}
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 f102421f0e..dc383994d3 100644
--- a/addressbook/gui/component/select-names/e-select-names-model.c
+++ b/addressbook/gui/component/select-names/e-select-names-model.c
@@ -592,6 +592,26 @@ e_select_names_model_delete_all (ESelectNamesModel *model)
}
void
+e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src)
+{
+ gint i, len;
+
+ g_return_if_fail (dest && E_IS_SELECT_NAMES_MODEL (dest));
+ g_return_if_fail (src && E_IS_SELECT_NAMES_MODEL (src));
+
+ if (src == dest)
+ return;
+
+ e_select_names_model_delete_all (dest);
+ len = e_select_names_model_count (src);
+ for (i = 0; i < len; ++i) {
+ const EDestination *d = e_select_names_model_get_destination (src, i);
+ if (d)
+ e_select_names_model_append (dest, e_destination_copy (d));
+ }
+}
+
+void
e_select_names_model_name_pos (ESelectNamesModel *model, gint index, gint *pos, gint *length)
{
gint rp = 0, i, len = 0;
diff --git a/addressbook/gui/component/select-names/e-select-names-model.h b/addressbook/gui/component/select-names/e-select-names-model.h
index 330f1ddd82..b11e9503ec 100644
--- a/addressbook/gui/component/select-names/e-select-names-model.h
+++ b/addressbook/gui/component/select-names/e-select-names-model.h
@@ -61,11 +61,12 @@ void e_select_names_model_import_destinationv (ESelectNamesModel
ECard *e_select_names_model_get_card (ESelectNamesModel *model, gint index);
const gchar *e_select_names_model_get_string (ESelectNamesModel *model, gint index);
-void e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination *dest);
-void e_select_names_model_append (ESelectNamesModel *model, EDestination *dest);
-void e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest);
-void e_select_names_model_delete (ESelectNamesModel *model, gint index);
-void e_select_names_model_delete_all (ESelectNamesModel *model);
+void e_select_names_model_insert (ESelectNamesModel *model, gint index, EDestination *dest);
+void e_select_names_model_append (ESelectNamesModel *model, EDestination *dest);
+void e_select_names_model_replace (ESelectNamesModel *model, gint index, EDestination *dest);
+void e_select_names_model_delete (ESelectNamesModel *model, gint index);
+void e_select_names_model_delete_all (ESelectNamesModel *model);
+void e_select_names_model_overwrite_copy (ESelectNamesModel *dest, ESelectNamesModel *src);
void e_select_names_model_clean (ESelectNamesModel *model);