[gnumeric] Sheet: GObject cleanup.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Sheet: GObject cleanup.
- Date: Mon, 16 May 2011 20:56:19 +0000 (UTC)
commit 7bfc9342a2a92c5601e3096250c63e695505f923
Author: Morten Welinder <terra gnome org>
Date: Mon May 16 16:56:03 2011 -0400
Sheet: GObject cleanup.
ChangeLog | 5 +++++
src/sheet.c | 35 +++++++++++++----------------------
2 files changed, 18 insertions(+), 22 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 19ea942..c45aad1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2011-05-16 Morten Welinder <terra gnome org>
+ * src/sheet.c (gnm_sheet_constructed): Changed from
+ gnm_sheet_constructor in order to do this later in the
+ construction sequence.
+ (gnm_sheet_class_init): Move sanity check here.
+
* src/expr-name.c (expr_name_new): Make this static.
2011-05-13 Morten Welinder <terra gnome org>
diff --git a/src/sheet.c b/src/sheet.c
index c286acf..1f9223e 100644
--- a/src/sheet.c
+++ b/src/sheet.c
@@ -645,27 +645,10 @@ gnm_sheet_get_property (GObject *object, guint property_id,
}
}
-static GObject *
-gnm_sheet_constructor (GType type,
- guint n_construct_properties,
- GObjectConstructParam *construct_params)
+static void
+gnm_sheet_constructed (GObject *obj)
{
- GObject *obj;
- Sheet *sheet;
- static gboolean warned = FALSE;
-
- if (GNM_MAX_COLS > 364238 && !warned) {
- /* Oh, yeah? */
- g_warning (_("This is a special version of Gnumeric. It has been compiled\n"
- "with support for a very large number of columns. Access to the\n"
- "column named TRUE may conflict with the constant of the same\n"
- "name. Expect weirdness."));
- warned = TRUE;
- }
-
- obj = parent_class->constructor (type, n_construct_properties,
- construct_params);
- sheet = SHEET (obj);
+ Sheet *sheet = SHEET (obj);
/* Now sheet_type, max_cols, and max_rows have been set. */
sheet->being_constructed = FALSE;
@@ -718,7 +701,7 @@ gnm_sheet_constructor (GType type,
sheet_scale_changed (sheet, TRUE, TRUE);
- return obj;
+ parent_class->constructed (obj);
}
static guint
@@ -826,12 +809,20 @@ gnm_sheet_init (Sheet *sheet)
static void
gnm_sheet_class_init (GObjectClass *gobject_class)
{
+ if (GNM_MAX_COLS > 364238) {
+ /* Oh, yeah? */
+ g_warning (_("This is a special version of Gnumeric. It has been compiled\n"
+ "with support for a very large number of columns. Access to the\n"
+ "column named TRUE may conflict with the constant of the same\n"
+ "name. Expect weirdness."));
+ }
+
parent_class = g_type_class_peek_parent (gobject_class);
gobject_class->set_property = gnm_sheet_set_property;
gobject_class->get_property = gnm_sheet_get_property;
gobject_class->finalize = gnm_sheet_finalize;
- gobject_class->constructor = gnm_sheet_constructor;
+ gobject_class->constructed = gnm_sheet_constructed;
g_object_class_install_property (gobject_class, PROP_SHEET_TYPE,
g_param_spec_enum ("sheet-type", _("Sheet Type"),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]