aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-18 23:54:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-19 08:32:06 +0800
commit78c9f356f97f0b40cbd3ad730b8931f75d0649a2 (patch)
treec2cef75d392b1deae3cfc44c3d6bb7b43c417d70 /addressbook
parentc6ccd45a0ef07b12a0313deb3abee032d89eec0a (diff)
downloadgsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar.gz
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar.bz2
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar.lz
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar.xz
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.tar.zst
gsoc2013-evolution-78c9f356f97f0b40cbd3ad730b8931f75d0649a2.zip
Convert ETableModel to an interface.
Similar to what was recently done to ETreeModel.
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.c41
-rw-r--r--addressbook/gui/widgets/e-addressbook-table-adapter.h4
2 files changed, 28 insertions, 17 deletions
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c
index 7a7dd4d69b..ee1ba7c75b 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.c
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c
@@ -49,10 +49,17 @@ struct _EAddressbookTableAdapterPrivate {
GHashTable *emails;
};
-G_DEFINE_TYPE (
+/* Forward Declarations */
+static void e_addressbook_table_adapter_table_model_init
+ (ETableModelInterface *interface);
+
+G_DEFINE_TYPE_WITH_CODE (
EAddressbookTableAdapter,
e_addressbook_table_adapter,
- E_TYPE_TABLE_MODEL)
+ G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (
+ E_TYPE_TABLE_MODEL,
+ e_addressbook_table_adapter_table_model_init))
static void
unlink_model (EAddressbookTableAdapter *adapter)
@@ -308,26 +315,30 @@ static void
e_addressbook_table_adapter_class_init (EAddressbookTableAdapterClass *class)
{
GObjectClass *object_class;
- ETableModelClass *model_class;
g_type_class_add_private (
class, sizeof (EAddressbookTableAdapterPrivate));
object_class = G_OBJECT_CLASS (class);
object_class->finalize = addressbook_finalize;
+}
- model_class = E_TABLE_MODEL_CLASS (class);
- model_class->column_count = addressbook_col_count;
- model_class->row_count = addressbook_row_count;
- model_class->append_row = addressbook_append_row;
- model_class->value_at = addressbook_value_at;
- model_class->set_value_at = addressbook_set_value_at;
- model_class->is_cell_editable = addressbook_is_cell_editable;
- model_class->duplicate_value = addressbook_duplicate_value;
- model_class->free_value = addressbook_free_value;
- model_class->initialize_value = addressbook_initialize_value;
- model_class->value_is_empty = addressbook_value_is_empty;
- model_class->value_to_string = addressbook_value_to_string;
+static void
+e_addressbook_table_adapter_table_model_init (ETableModelInterface *interface)
+{
+ interface->column_count = addressbook_col_count;
+ interface->row_count = addressbook_row_count;
+ interface->append_row = addressbook_append_row;
+
+ interface->value_at = addressbook_value_at;
+ interface->set_value_at = addressbook_set_value_at;
+ interface->is_cell_editable = addressbook_is_cell_editable;
+
+ interface->duplicate_value = addressbook_duplicate_value;
+ interface->free_value = addressbook_free_value;
+ interface->initialize_value = addressbook_initialize_value;
+ interface->value_is_empty = addressbook_value_is_empty;
+ interface->value_to_string = addressbook_value_to_string;
}
static void
diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.h b/addressbook/gui/widgets/e-addressbook-table-adapter.h
index 4b089b2d0a..93b7ae9553 100644
--- a/addressbook/gui/widgets/e-addressbook-table-adapter.h
+++ b/addressbook/gui/widgets/e-addressbook-table-adapter.h
@@ -49,12 +49,12 @@ typedef struct _EAddressbookTableAdapterClass EAddressbookTableAdapterClass;
typedef struct _EAddressbookTableAdapterPrivate EAddressbookTableAdapterPrivate;
struct _EAddressbookTableAdapter {
- ETableModel parent;
+ GObject parent;
EAddressbookTableAdapterPrivate *priv;
};
struct _EAddressbookTableAdapterClass {
- ETableModelClass parent_class;
+ GObjectClass parent_class;
};
GType e_addressbook_table_adapter_get_type