r19708 - gnucash/trunk/src/gnome-utils - Fix gtk warnings when erroneously setting the fixed-width property to zero.
Christian Stimming
cstim at code.gnucash.org
Mon Oct 25 14:50:11 EDT 2010
Author: cstim
Date: 2010-10-25 14:50:11 -0400 (Mon, 25 Oct 2010)
New Revision: 19708
Trac: http://svn.gnucash.org/trac/changeset/19708
Modified:
gnucash/trunk/src/gnome-utils/gnc-tree-view.c
Log:
Fix gtk warnings when erroneously setting the fixed-width property to zero.
Modified: gnucash/trunk/src/gnome-utils/gnc-tree-view.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-tree-view.c 2010-10-25 18:16:14 UTC (rev 19707)
+++ gnucash/trunk/src/gnome-utils/gnc-tree-view.c 2010-10-25 18:50:11 UTC (rev 19708)
@@ -1805,7 +1805,6 @@
gboolean visible;
int width = 0;
gchar *key;
- GtkTreeViewColumnSizing sizing = GTK_TREE_VIEW_COLUMN_FIXED;
/* Set data used by other functions */
if (pref_name)
@@ -1818,10 +1817,20 @@
/* Get visibility */
visible = gnc_tree_view_column_visible(view, NULL, pref_name);
+ /* Set column attributes (without the sizing) */
+ g_object_set(G_OBJECT(column),
+ "visible", visible,
+ "resizable", resizable && pref_name != NULL,
+ "reorderable", pref_name != NULL,
+ NULL);
+
/* Get width */
if (default_width == 0)
{
- sizing = GTK_TREE_VIEW_COLUMN_AUTOSIZE;
+ /* Set the sizing column attributes */
+ g_object_set(G_OBJECT(column),
+ "sizing", GTK_TREE_VIEW_COLUMN_AUTOSIZE,
+ NULL);
}
else
{
@@ -1840,17 +1849,14 @@
width = default_width + 10;
if (width == 0)
width = 10;
+
+ /* Set the sizing column attributes (including fixed-width) */
+ g_object_set(G_OBJECT(column),
+ "sizing", GTK_TREE_VIEW_COLUMN_FIXED,
+ "fixed-width", width,
+ NULL);
}
- /* Set column attributes */
- g_object_set(G_OBJECT(column),
- "visible", visible,
- "sizing", sizing,
- "fixed-width", width,
- "resizable", resizable && pref_name != NULL,
- "reorderable", pref_name != NULL,
- NULL);
-
s_model = gtk_tree_view_get_model(GTK_TREE_VIEW(view));
if (GTK_IS_TREE_SORTABLE(s_model))
{
More information about the gnucash-changes
mailing list