aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-column-specification.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-14 02:53:51 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-14 02:53:51 +0800
commitc144d2091888813efe3b7ae4414b356fd080b610 (patch)
tree727511bf87a68e794081e42191009a5a67b440ea /widgets/table/e-table-column-specification.c
parent9704f5dbf64e9f34d4ef7b4c0844b82319d4a2cf (diff)
downloadgsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.tar.gz
gsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.tar.zst
gsoc2013-evolution-c144d2091888813efe3b7ae4414b356fd080b610.zip
Added e-table-config-field.lo.
2000-10-13 Christopher James Lahey <clahey@helixcode.com> * gal/Makefile.am: Added e-table-config-field.lo. * tests/test-tree-2.c: Changed this to use cursor-mode in the xml instead of the no longer existing gtk argument. From gal/e-table/ChangeLog: 2000-10-13 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-config-field.c and e-table-config-field.h. * e-table-column-specification.c: Cleaned this up a bit. Made it leak less memory. * e-table-config-field.c, e-table-config-field.h: New files. This is the configuration widgets for sorting or grouping. * e-table-config.c, e-table-config.h: Nuked these and replaced them with a widget that handles all the ETable configuration. * e-table-config.glade, e-table-config.glade.h: Updated this a bit to match what's actually being used better. This isn't used in actual code. * e-table-header-item.c, e-table-header-item.h: Added a pointer to the table in the header item structure so that we can launch the configuration from the header item right click menu. Made the header item launch the ETable configuration dialog. * e-table.c, e-table.h: Keep the spec given to us around. Added a get_state_object function which returns an ETableState *. Set the "table" argument on the header item. svn path=/trunk/; revision=5901
Diffstat (limited to 'widgets/table/e-table-column-specification.c')
-rw-r--r--widgets/table/e-table-column-specification.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/widgets/table/e-table-column-specification.c b/widgets/table/e-table-column-specification.c
index 1b16fdf170..88604e03ea 100644
--- a/widgets/table/e-table-column-specification.c
+++ b/widgets/table/e-table-column-specification.c
@@ -21,14 +21,20 @@
static GtkObjectClass *etcs_parent_class;
static void
-etcs_destroy (GtkObject *object)
+free_strings (ETableColumnSpecification *etcs)
{
- ETableColumnSpecification *etcs = E_TABLE_COLUMN_SPECIFICATION (object);
-
g_free(etcs->title_);
g_free(etcs->pixbuf);
g_free(etcs->cell);
g_free(etcs->compare);
+}
+
+static void
+etcs_destroy (GtkObject *object)
+{
+ ETableColumnSpecification *etcs = E_TABLE_COLUMN_SPECIFICATION (object);
+
+ free_strings(etcs);
GTK_OBJECT_CLASS (etcs_parent_class)->destroy (object);
}
@@ -45,7 +51,7 @@ static void
etcs_init (ETableColumnSpecification *specification)
{
specification->model_col = 0;
- specification->title_ = NULL;
+ specification->title_ = g_strdup("");
specification->pixbuf = NULL;
specification->expansion = 0;
@@ -67,19 +73,24 @@ e_table_column_specification_new (void)
}
void
-e_table_column_specification_load_from_node (ETableColumnSpecification *specification,
+e_table_column_specification_load_from_node (ETableColumnSpecification *etcs,
const xmlNode *node)
{
- specification->model_col = e_xml_get_integer_prop_by_name(node, "model_col");
- specification->title_ = e_xml_get_translated_string_prop_by_name(node, "_title");
- specification->pixbuf = e_xml_get_translated_string_prop_by_name(node, "pixbuf");
+ free_strings(etcs);
+
+ etcs->model_col = e_xml_get_integer_prop_by_name(node, "model_col");
+ etcs->title_ = e_xml_get_translated_string_prop_by_name(node, "_title");
+ etcs->pixbuf = e_xml_get_translated_string_prop_by_name(node, "pixbuf");
+
+ etcs->expansion = e_xml_get_double_prop_by_name(node, "expansion");
+ etcs->minimum_width = e_xml_get_integer_prop_by_name(node, "minimum_width");
+ etcs->resizable = e_xml_get_bool_prop_by_name(node, "resizable");
- specification->expansion = e_xml_get_double_prop_by_name(node, "expansion");
- specification->minimum_width = e_xml_get_integer_prop_by_name(node, "minimum_width");
- specification->resizable = e_xml_get_bool_prop_by_name(node, "resizable");
+ etcs->cell = e_xml_get_string_prop_by_name(node, "cell");
+ etcs->compare = e_xml_get_string_prop_by_name(node, "compare");
- specification->cell = e_xml_get_string_prop_by_name(node, "cell");
- specification->compare = e_xml_get_string_prop_by_name(node, "compare");
+ if (etcs->title_ == NULL)
+ etcs->title_ = g_strdup("");
}
xmlNode *