aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-scrolled.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@src.gnome.org>2007-07-09 11:25:31 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2007-07-09 11:25:31 +0800
commitc5d5b30780fd85d6e143acbd170a2bab9d6bd5a9 (patch)
treed868735205c1a6f4852d4700fe255692de8165e1 /widgets/table/e-tree-scrolled.c
parent0885119ef7c4bf7123d822e001c99c15e0fffcae (diff)
downloadgsoc2013-evolution-c5d5b30780fd85d6e143acbd170a2bab9d6bd5a9.tar.gz
gsoc2013-evolution-c5d5b30780fd85d6e143acbd170a2bab9d6bd5a9.tar.zst
gsoc2013-evolution-c5d5b30780fd85d6e143acbd170a2bab9d6bd5a9.zip
Fix for bug #353752
svn path=/trunk/; revision=33777
Diffstat (limited to 'widgets/table/e-tree-scrolled.c')
-rw-r--r--widgets/table/e-tree-scrolled.c66
1 files changed, 38 insertions, 28 deletions
diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c
index 1f1145065f..ce85ea8dbc 100644
--- a/widgets/table/e-tree-scrolled.c
+++ b/widgets/table/e-tree-scrolled.c
@@ -73,24 +73,26 @@ e_tree_scrolled_real_construct (ETreeScrolled *ets)
gtk_widget_show(GTK_WIDGET(ets->tree));
}
-ETreeScrolled *e_tree_scrolled_construct (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec,
- const char *state)
+gboolean
+e_tree_scrolled_construct (ETreeScrolled *ets,
+ ETreeModel *etm,
+ ETableExtras *ete,
+ const char *spec,
+ const char *state)
{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec != NULL, NULL);
+ g_return_val_if_fail(ets != NULL, FALSE);
+ g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), FALSE);
+ g_return_val_if_fail(etm != NULL, FALSE);
+ g_return_val_if_fail(E_IS_TREE_MODEL(etm), FALSE);
+ g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), FALSE);
+ g_return_val_if_fail(spec != NULL, FALSE);
- e_tree_construct(ets->tree, etm, ete, spec, state);
+ if (!e_tree_construct (ets->tree, etm, ete, spec, state))
+ return FALSE;
e_tree_scrolled_real_construct(ets);
- return ets;
+ return TRUE;
}
GtkWidget *e_tree_scrolled_new (ETreeModel *etm,
@@ -110,29 +112,34 @@ GtkWidget *e_tree_scrolled_new (ETreeModel *etm
"vadjustment", NULL,
NULL));
- ets = e_tree_scrolled_construct (ets, etm, ete, spec, state);
+ if (!e_tree_scrolled_construct (ets, etm, ete, spec, state)) {
+ g_object_unref (ets);
+ return NULL;
+ }
return GTK_WIDGET (ets);
}
-ETreeScrolled *e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets,
- ETreeModel *etm,
- ETableExtras *ete,
- const char *spec_fn,
- const char *state_fn)
+gboolean
+e_tree_scrolled_construct_from_spec_file (ETreeScrolled *ets,
+ ETreeModel *etm,
+ ETableExtras *ete,
+ const char *spec_fn,
+ const char *state_fn)
{
- g_return_val_if_fail(ets != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), NULL);
- g_return_val_if_fail(etm != NULL, NULL);
- g_return_val_if_fail(E_IS_TREE_MODEL(etm), NULL);
- g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), NULL);
- g_return_val_if_fail(spec_fn != NULL, NULL);
+ g_return_val_if_fail(ets != NULL, FALSE);
+ g_return_val_if_fail(E_IS_TREE_SCROLLED(ets), FALSE);
+ g_return_val_if_fail(etm != NULL, FALSE);
+ g_return_val_if_fail(E_IS_TREE_MODEL(etm), FALSE);
+ g_return_val_if_fail(ete == NULL || E_IS_TABLE_EXTRAS(ete), FALSE);
+ g_return_val_if_fail(spec_fn != NULL, FALSE);
- e_tree_construct_from_spec_file(ets->tree, etm, ete, spec_fn, state_fn);
+ if (!e_tree_construct_from_spec_file (ets->tree, etm, ete, spec_fn, state_fn))
+ return FALSE;
e_tree_scrolled_real_construct(ets);
- return ets;
+ return TRUE;
}
GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm,
@@ -151,7 +158,10 @@ GtkWidget *e_tree_scrolled_new_from_spec_file (ETreeModel *etm
"hadjustment", NULL,
"vadjustment", NULL,
NULL));
- ets = e_tree_scrolled_construct_from_spec_file (ets, etm, ete, spec_fn, state_fn);
+ if (!e_tree_scrolled_construct_from_spec_file (ets, etm, ete, spec_fn, state_fn)) {
+ g_object_unref (ets);
+ return NULL;
+ }
return GTK_WIDGET (ets);
}