aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-11 06:29:50 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-11 08:19:33 +0800
commit6af1b3178dcf5e3271f6be4d785c28cbe9043404 (patch)
treef3d05886ecb1a9f300adca7799ca59f8de4e717c /widgets/table
parentc0533ef0530a1dfb8802731ad5fe6c4f8b3dccaf (diff)
downloadgsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.gz
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.tar.zst
gsoc2013-evolution-6af1b3178dcf5e3271f6be4d785c28cbe9043404.zip
Clean up GalView and related classes.
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-table-specification.c2
-rw-r--r--widgets/table/e-table-specification.h12
-rw-r--r--widgets/table/e-table-state.c14
3 files changed, 20 insertions, 8 deletions
diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c
index d837b7344e..5d2bcad32c 100644
--- a/widgets/table/e-table-specification.c
+++ b/widgets/table/e-table-specification.c
@@ -111,7 +111,7 @@ etsp_init (ETableSpecification *etsp)
ETableSpecification *
e_table_specification_new (void)
{
- ETableSpecification *etsp = g_object_new (E_TABLE_SPECIFICATION_TYPE, NULL);
+ ETableSpecification *etsp = g_object_new (E_TYPE_TABLE_SPECIFICATION, NULL);
return (ETableSpecification *) etsp;
}
diff --git a/widgets/table/e-table-specification.h b/widgets/table/e-table-specification.h
index c2ca7a018d..e6f6707ae5 100644
--- a/widgets/table/e-table-specification.h
+++ b/widgets/table/e-table-specification.h
@@ -33,12 +33,12 @@
G_BEGIN_DECLS
-#define E_TABLE_SPECIFICATION_TYPE (e_table_specification_get_type ())
-#define E_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TABLE_SPECIFICATION_TYPE, ETableSpecification))
-#define E_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TABLE_SPECIFICATION_TYPE, ETableSpecificationClass))
-#define E_IS_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TABLE_SPECIFICATION_TYPE))
-#define E_IS_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TABLE_SPECIFICATION_TYPE))
-#define E_TABLE_SPECIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TABLE_SPECIFICATION_TYPE, ETableSpecificationClass))
+#define E_TYPE_TABLE_SPECIFICATION (e_table_specification_get_type ())
+#define E_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), E_TYPE_TABLE_SPECIFICATION, ETableSpecification))
+#define E_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), E_TYPE_TABLE_SPECIFICATION, ETableSpecificationClass))
+#define E_IS_TABLE_SPECIFICATION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), E_TYPE_TABLE_SPECIFICATION))
+#define E_IS_TABLE_SPECIFICATION_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), E_TYPE_TABLE_SPECIFICATION))
+#define E_TABLE_SPECIFICATION_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), E_TYPE_TABLE_SPECIFICATION, ETableSpecificationClass))
typedef struct {
GObject base;
diff --git a/widgets/table/e-table-state.c b/widgets/table/e-table-state.c
index 46d0c355e8..1360271680 100644
--- a/widgets/table/e-table-state.c
+++ b/widgets/table/e-table-state.c
@@ -119,6 +119,9 @@ e_table_state_load_from_file (ETableState *state,
{
xmlDoc *doc;
+ g_return_val_if_fail (E_IS_TABLE_STATE (state), FALSE);
+ g_return_val_if_fail (filename != NULL, FALSE);
+
doc = e_xml_parse_file (filename);
if (doc) {
xmlNode *node = xmlDocGetRootElement(doc);
@@ -135,6 +138,9 @@ e_table_state_load_from_string (ETableState *state,
{
xmlDoc *doc;
+ g_return_if_fail (E_IS_TABLE_STATE (state));
+ g_return_if_fail (xml != NULL);
+
doc = xmlParseMemory ((gchar *) xml, strlen(xml));
if (doc) {
xmlNode *node = xmlDocGetRootElement(doc);
@@ -157,6 +163,9 @@ e_table_state_load_from_node (ETableState *state,
gdouble state_version;
gint i;
+ g_return_if_fail (E_IS_TABLE_STATE (state));
+ g_return_if_fail (node != NULL);
+
state_version = e_xml_get_double_prop_by_name_with_default (
node, (const guchar *)"state-version", STATE_VERSION);
@@ -227,6 +236,8 @@ e_table_state_save_to_string (ETableState *state)
gint length;
xmlDoc *doc;
+ g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL);
+
doc = xmlNewDoc((const guchar *)"1.0");
xmlDocSetRootElement(doc, e_table_state_save_to_node(state, NULL));
xmlDocDumpMemory(doc, &string, &length);
@@ -244,6 +255,8 @@ e_table_state_save_to_node (ETableState *state,
gint i;
xmlNode *node;
+ g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL);
+
if (parent)
node = xmlNewChild (
parent, NULL, (const guchar *) "ETableState", NULL);
@@ -287,7 +300,6 @@ e_table_state_duplicate (ETableState *state)
ETableState *new_state;
gchar *copy;
- g_return_val_if_fail (state != NULL, NULL);
g_return_val_if_fail (E_IS_TABLE_STATE (state), NULL);
new_state = e_table_state_new ();