aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-state.c
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2002-11-06 06:53:40 +0800
committerMike Kestner <mkestner@src.gnome.org>2002-11-06 06:53:40 +0800
commit9b97a17eb728152cebe16d53d842c950a85b3505 (patch)
tree2ccddb671fdb7826e36a67b4e8b3bccebd7cb483 /widgets/table/e-table-state.c
parentc7f67942ca864e5d158102eab7f26f6285a05b05 (diff)
downloadgsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.gz
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.bz2
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.lz
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.xz
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.tar.zst
gsoc2013-evolution-9b97a17eb728152cebe16d53d842c950a85b3505.zip
GObjectify GObjectify GObjectify use GObject api for models use GObject
2002-11-05 Mike Kestner <mkestner@ximian.com> * e-table-col.[ch] : GObjectify * e-table-column-specification.[ch] : GObjectify * e-table-config.[ch] : GObjectify * e-table-group-leaf.c : use GObject api for models * e-table-group.c : use GObject api for models * e-table-header-item.c : use GObject api for models * e-table-header.c : use GObject api for models * e-table-selection-model.c : use GObject api for models * e-table-sort-info.[ch] : GObjectify * e-table-sorted.[ch] : GObjectify * e-table-sorter.c : use GObject api for models * e-table-specification.c : use GObject api for models * e-table-state.[ch] : GObjectify * e-table-subset-variable.[ch] : GObjectify * e-table-subset.[ch] : GObjectify * e-table.c : use GObject api for models svn path=/trunk/; revision=18571
Diffstat (limited to 'widgets/table/e-table-state.c')
-rw-r--r--widgets/table/e-table-state.c45
1 files changed, 23 insertions, 22 deletions
diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c
index 64b911f38f..9dd1020430 100644
--- a/widgets/table/e-table-state.c
+++ b/widgets/table/e-table-state.c
@@ -28,8 +28,6 @@
#include <stdlib.h>
#include <string.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkobject.h>
#include <libxml/parser.h>
#include <libxml/xmlmemory.h>
#include "gal/util/e-util.h"
@@ -37,14 +35,25 @@
#include "e-table-state.h"
-#define PARENT_TYPE (gtk_object_get_type())
-
#define STATE_VERSION 0.1
-static GtkObjectClass *etst_parent_class;
+static GObjectClass *etst_parent_class;
static void
-etst_destroy (GtkObject *object)
+etst_dispose (GObject *object)
+{
+ ETableState *etst = E_TABLE_STATE (object);
+
+ if (etst->sort_info) {
+ g_object_unref (etst->sort_info);
+ etst->sort_info = NULL;
+ }
+
+ G_OBJECT_CLASS (etst_parent_class)->dispose (object);
+}
+
+static void
+etst_finalize (GObject *object)
{
ETableState *etst = E_TABLE_STATE (object);
@@ -58,40 +67,32 @@ etst_destroy (GtkObject *object)
etst->expansions = NULL;
}
- if (etst->sort_info) {
- gtk_object_unref (GTK_OBJECT (etst->sort_info));
- etst->sort_info = NULL;
- }
-
- GTK_OBJECT_CLASS (etst_parent_class)->destroy (object);
+ G_OBJECT_CLASS (etst_parent_class)->finalize (object);
}
static void
-etst_class_init (GtkObjectClass *klass)
+etst_class_init (GObjectClass *klass)
{
- etst_parent_class = gtk_type_class (PARENT_TYPE);
+ etst_parent_class = g_type_class_peek_parent (klass);
- klass->destroy = etst_destroy;
+ klass->dispose = etst_dispose;
+ klass->finalize = etst_finalize;
}
static void
etst_init (ETableState *state)
{
- GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (state), GTK_FLOATING);
-
state->columns = NULL;
state->expansions = NULL;
state->sort_info = e_table_sort_info_new();
}
-E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, PARENT_TYPE)
+E_MAKE_TYPE(e_table_state, "ETableState", ETableState, etst_class_init, etst_init, G_TYPE_OBJECT)
ETableState *
e_table_state_new (void)
{
- ETableState *etst = gtk_type_new (E_TABLE_STATE_TYPE);
-
- return (ETableState *) etst;
+ return (ETableState *) g_object_new (E_TABLE_STATE_TYPE, NULL);
}
ETableState *
@@ -160,7 +161,7 @@ e_table_state_load_from_node (ETableState *state,
node, "state-version", STATE_VERSION);
if (state->sort_info)
- gtk_object_unref (GTK_OBJECT(state->sort_info));
+ g_object_unref (state->sort_info);
state->sort_info = NULL;
children = node->xmlChildrenNode;