aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/e-cardlist-model.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-02 06:29:10 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-02 06:29:10 +0800
commit5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf (patch)
treea8a02635e105fd6c4a11fb163249c6420755cece /addressbook/gui/component/e-cardlist-model.c
parent8f4bcac53f23aa42a221f2105263a33521e77c85 (diff)
downloadgsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar.gz
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar.bz2
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar.lz
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar.xz
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.tar.zst
gsoc2013-evolution-5ea91bd94b21b27d83d0f6b14d64ce8c0df88acf.zip
return TRUE if opening a contact editor so that we don't get a "new
2000-06-01 Christopher James Lahey <clahey@helixcode.com> * gui/minicard/e-minicard.c: return TRUE if opening a contact editor so that we don't get a "new dialog" contact editor. svn path=/trunk/; revision=3342
Diffstat (limited to 'addressbook/gui/component/e-cardlist-model.c')
-rw-r--r--addressbook/gui/component/e-cardlist-model.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/addressbook/gui/component/e-cardlist-model.c b/addressbook/gui/component/e-cardlist-model.c
index 1bc9bb4c2b..eb6793ec6f 100644
--- a/addressbook/gui/component/e-cardlist-model.c
+++ b/addressbook/gui/component/e-cardlist-model.c
@@ -116,22 +116,31 @@ addressbook_thaw (ETableModel *etc)
}
void
-add_card(ECardlistModel *model,
- ECard **cards,
- int count)
+e_cardlist_model_add(ECardlistModel *model,
+ ECard **cards,
+ int count)
{
int i;
model->data = g_realloc(model->data, model->data_count + count * sizeof(ECard *));
for (i = 0; i < count; i++) {
- gtk_object_ref(GTK_OBJECT(cards[i]));
- model->data[model->data_count++] = e_card_simple_new (cards[i]);
- e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
+ gboolean found = FALSE;
+ gchar *id = e_card_get_id(cards[i]);
+ for ( i = 0; i < model->data_count; i++) {
+ if ( !strcmp(e_card_simple_get_id(model->data[i]), id) ) {
+ found = TRUE;
+ }
+ }
+ if (!found) {
+ gtk_object_ref(GTK_OBJECT(cards[i]));
+ model->data[model->data_count++] = e_card_simple_new (cards[i]);
+ e_table_model_row_inserted(E_TABLE_MODEL(model), model->data_count - 1);
+ }
}
}
void
-remove_card(ECardlistModel *model,
- const char *id)
+e_cardlist_model_remove(ECardlistModel *model,
+ const char *id)
{
int i;
for ( i = 0; i < model->data_count; i++) {
@@ -171,8 +180,8 @@ e_cardlist_model_init (GtkObject *object)
}
ECard *
-e_cardlist_model_get_card(ECardlistModel *model,
- int row)
+e_cardlist_model_get(ECardlistModel *model,
+ int row)
{
if (model->data && row < model->data_count) {
ECard *card;