aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-04-03 22:50:38 +0800
committerChris Lahey <clahey@src.gnome.org>2001-04-03 22:50:38 +0800
commit0cebe028cbf4d2292740c2b4cfb71efe57b3087e (patch)
treed363096b167f6bedb00cc14ba0099a6ff9cea94b /addressbook
parent92043633cb2e9ca6ffd516f2dd162a5e84fe63c1 (diff)
downloadgsoc2013-evolution-0cebe028cbf4d2292740c2b4cfb71efe57b3087e.tar.gz
gsoc2013-evolution-0cebe028cbf4d2292740c2b4cfb71efe57b3087e.tar.zst
gsoc2013-evolution-0cebe028cbf4d2292740c2b4cfb71efe57b3087e.zip
Made this table model more consistent in the number of columns it has.
2001-04-03 Christopher James Lahey <clahey@ximian.com> * gui/widgets/e-addressbook-model.c (COLS): Made this table model more consistent in the number of columns it has. (addressbook_append_row): Fixed this function. We removed the col offset. svn path=/trunk/; revision=9129
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/gui/widgets/e-addressbook-model.c12
2 files changed, 14 insertions, 5 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 121ce5ec24..fb6d83ea05 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2001-04-03 Christopher James Lahey <clahey@ximian.com>
+
+ * gui/widgets/e-addressbook-model.c (COLS): Made this table model
+ more consistent in the number of columns it has.
+ (addressbook_append_row): Fixed this function. We removed the col
+ offset.
+
2001-04-02 Iain Holmes <iain@ximian.com>
* backend/ebook/evolution-gnomecard-importer.c (importer_init): Shut
diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c
index 71c0db892c..abd97c8464 100644
--- a/addressbook/gui/widgets/e-addressbook-model.c
+++ b/addressbook/gui/widgets/e-addressbook-model.c
@@ -37,6 +37,8 @@ enum {
LAST_SIGNAL
};
+#define COLS (E_CARD_SIMPLE_FIELD_LAST - 5)
+
static guint e_addressbook_model_signals [LAST_SIGNAL] = {0, };
static void
@@ -90,7 +92,7 @@ addressbook_destroy(GtkObject *object)
static int
addressbook_col_count (ETableModel *etc)
{
- return E_CARD_SIMPLE_FIELD_LAST - 4;
+ return COLS;
}
/* This function returns the number of rows in our ETableModel. */
@@ -107,7 +109,7 @@ addressbook_value_at (ETableModel *etc, int col, int row)
{
EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc);
const char *value;
- if ( col >= E_CARD_SIMPLE_FIELD_LAST || row >= addressbook->data_count )
+ if ( col >= COLS || row >= addressbook->data_count )
return NULL;
value = e_card_simple_get_const(addressbook->data[row],
@@ -122,7 +124,7 @@ addressbook_set_value_at (ETableModel *etc, int col, int row, const void *val)
EAddressbookModel *addressbook = E_ADDRESSBOOK_MODEL(etc);
ECard *card;
if (addressbook->editable) {
- if ( col >= E_CARD_SIMPLE_FIELD_LAST|| row >= addressbook->data_count )
+ if ( col >= COLS|| row >= addressbook->data_count )
return;
e_card_simple_set(addressbook->data[row],
col,
@@ -154,10 +156,10 @@ addressbook_append_row (ETableModel *etm, ETableModel *source, gint row)
card = e_card_new("");
simple = e_card_simple_new(card);
- for (col = 0; col < E_CARD_SIMPLE_FIELD_LAST - 1; col++) {
+ for (col = 0; col < COLS; col++) {
const void *val = e_table_model_value_at(source, col, row);
e_card_simple_set(simple,
- col + 1,
+ col,
val);
}
e_card_simple_sync_card(simple);