aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-08-28 23:27:38 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-08-28 23:27:38 +0800
commit876558f75fd7342eb4cb95a45c6173d4a876bbc1 (patch)
treec96a7bf68309db331b3c3b7d38b0e592b0f880f3
parente3913975e84bff02feedb4252d4ecb2cddce211f (diff)
downloadgsoc2013-evolution-876558f75fd7342eb4cb95a45c6173d4a876bbc1.tar.gz
gsoc2013-evolution-876558f75fd7342eb4cb95a45c6173d4a876bbc1.tar.zst
gsoc2013-evolution-876558f75fd7342eb4cb95a45c6173d4a876bbc1.zip
Remove a ton of (hopefully harmless) warnings from the ETable code.
svn path=/trunk/; revision=5081
-rw-r--r--widgets/e-table/ChangeLog14
-rw-r--r--widgets/e-table/e-table-group-leaf.c8
-rw-r--r--widgets/e-table/e-table.c11
-rw-r--r--widgets/e-table/e-tree-model.c3
-rw-r--r--widgets/table/e-table-group-leaf.c8
-rw-r--r--widgets/table/e-table.c11
-rw-r--r--widgets/table/e-tree-model.c3
7 files changed, 46 insertions, 12 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index 3fba867267..f763b50eaf 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,17 @@
+2000-08-28 Ettore Perazzoli <ettore@helixcode.com>
+
+ * e-table.c (et_destroy): Don't try to destroy the `header_canvas'
+ if NULL.
+
+ * e-table-group-leaf.c (etgl_set_cursor_row): If the item is NULL,
+ don't try to set the cursor row for it.
+
+ * e-table.c (set_scroll_adjustments): Don't set the adjustment for
+ the `header_canvas' unless the `header_canvas' is not NULL.
+
+ * e-tree-model.c (e_tree_model_row_of_node): If the node is the
+ root, just return -1 without emitting a warning.
+
2000-08-25 Christopher James Lahey <clahey@helixcode.com>
* e-table-col.c, e-table-config.c, e-table-header.c,
diff --git a/widgets/e-table/e-table-group-leaf.c b/widgets/e-table/e-table-group-leaf.c
index d083d44f21..082963a616 100644
--- a/widgets/e-table/e-table-group-leaf.c
+++ b/widgets/e-table/e-table-group-leaf.c
@@ -227,9 +227,11 @@ static void
etgl_set_cursor_row (ETableGroup *etg, gint row)
{
ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
- "cursor_row", row,
- NULL);
+
+ if (etgl->item != NULL)
+ gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
+ "cursor_row", row,
+ NULL);
}
static int
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index 7906ad877d..89f032b401 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -146,7 +146,10 @@ et_destroy (GtkObject *object)
gtk_object_unref (GTK_OBJECT (et->header));
gtk_object_unref (GTK_OBJECT (et->sort_info));
gtk_object_unref (GTK_OBJECT (et->sorter));
- gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
+ if (et->header_canvas != NULL)
+ gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
gtk_widget_destroy (GTK_WIDGET (et->table_canvas));
if (et->rebuild_idle_id) {
@@ -997,8 +1000,10 @@ set_scroll_adjustments (ETable *table,
hadjustment);
gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),
vadjustment);
- gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
- hadjustment);
+
+ if (table->header_canvas != NULL)
+ gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
+ hadjustment);
}
gint
diff --git a/widgets/e-table/e-tree-model.c b/widgets/e-table/e-tree-model.c
index c57bf2d683..f6d8ddddd5 100644
--- a/widgets/e-table/e-tree-model.c
+++ b/widgets/e-table/e-tree-model.c
@@ -446,6 +446,9 @@ e_tree_model_row_of_node (ETreeModel *etree, ETreePath *node)
{
int i;
+ if (etree->root == node)
+ return -1;
+
for (i = 0; i < etree->row_array->len; i ++)
if (g_array_index (etree->row_array, GNode*, i) == node)
return i;
diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c
index d083d44f21..082963a616 100644
--- a/widgets/table/e-table-group-leaf.c
+++ b/widgets/table/e-table-group-leaf.c
@@ -227,9 +227,11 @@ static void
etgl_set_cursor_row (ETableGroup *etg, gint row)
{
ETableGroupLeaf *etgl = E_TABLE_GROUP_LEAF (etg);
- gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
- "cursor_row", row,
- NULL);
+
+ if (etgl->item != NULL)
+ gnome_canvas_item_set(GNOME_CANVAS_ITEM(etgl->item),
+ "cursor_row", row,
+ NULL);
}
static int
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 7906ad877d..89f032b401 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -146,7 +146,10 @@ et_destroy (GtkObject *object)
gtk_object_unref (GTK_OBJECT (et->header));
gtk_object_unref (GTK_OBJECT (et->sort_info));
gtk_object_unref (GTK_OBJECT (et->sorter));
- gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
+ if (et->header_canvas != NULL)
+ gtk_widget_destroy (GTK_WIDGET (et->header_canvas));
+
gtk_widget_destroy (GTK_WIDGET (et->table_canvas));
if (et->rebuild_idle_id) {
@@ -997,8 +1000,10 @@ set_scroll_adjustments (ETable *table,
hadjustment);
gtk_layout_set_vadjustment (GTK_LAYOUT(table->table_canvas),
vadjustment);
- gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
- hadjustment);
+
+ if (table->header_canvas != NULL)
+ gtk_layout_set_hadjustment (GTK_LAYOUT(table->header_canvas),
+ hadjustment);
}
gint
diff --git a/widgets/table/e-tree-model.c b/widgets/table/e-tree-model.c
index c57bf2d683..f6d8ddddd5 100644
--- a/widgets/table/e-tree-model.c
+++ b/widgets/table/e-tree-model.c
@@ -446,6 +446,9 @@ e_tree_model_row_of_node (ETreeModel *etree, ETreePath *node)
{
int i;
+ if (etree->root == node)
+ return -1;
+
for (i = 0; i < etree->row_array->len; i ++)
if (g_array_index (etree->row_array, GNode*, i) == node)
return i;