summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2008-05-27 23:16:06 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2008-05-27 23:16:06 +0000
commitea9c6f301d686a92487ed9cbcfafcde7a2e3bed8 (patch)
treeca21e57d7550f271340fb5bfe63c66f22c2f4c91
parent2855f81636de924f751931115d886df8cb0f522a (diff)
downloadgdk-pixbuf-ea9c6f301d686a92487ed9cbcfafcde7a2e3bed8.tar.gz
Bug 485218 - Strange warning encountered
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted): (gtk_tree_model_sort_convert_child_iter_to_iter): (gtk_tree_model_sort_build_level): Better warnings. Patch by Kristian Rietveld. svn path=/trunk/; revision=20198
-rw-r--r--ChangeLog11
-rw-r--r--gtk/gtktreemodelsort.c37
2 files changed, 43 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index f0de74b18..66d8f15b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,15 @@
2008-05-27 Matthias Clasen <mclasen@redhat.com>
- Bug 351910 – Search column setting lost
+ Bug 485218 - Strange warning encountered
+
+ * gtk/gtktreemodelsort.c (gtk_tree_model_sort_row_inserted):
+ (gtk_tree_model_sort_convert_child_iter_to_iter):
+ (gtk_tree_model_sort_build_level): Better warnings. Patch
+ by Kristian Rietveld.
+
+2008-05-27 Matthias Clasen <mclasen@redhat.com>
+
+ Bug 351910 - Search column setting lost
* gtk/gtktreeview.c (gtk_tree_view_set_search_column): Clarify
the docs. Patch by Matt Barnes.
diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c
index 0887c3ed3..0c80ef427 100644
--- a/gtk/gtktreemodelsort.c
+++ b/gtk/gtktreemodelsort.c
@@ -630,9 +630,10 @@ gtk_tree_model_sort_row_inserted (GtkTreeModel *s_model,
if (level->array->len < gtk_tree_path_get_indices (s_path)[i])
{
- g_warning ("A node was inserted with a parent that's not in the tree.\n"
+ g_warning ("%s: A node was inserted with a parent that's not in the tree.\n"
"This possibly means that a GtkTreeModel inserted a child node\n"
- "before the parent was inserted.");
+ "before the parent was inserted.",
+ G_STRLOC);
goto done;
}
@@ -2080,7 +2081,12 @@ gtk_tree_model_sort_convert_child_iter_to_iter (GtkTreeModelSort *tree_model_sor
path = gtk_tree_model_sort_convert_child_path_to_path (tree_model_sort, child_path);
gtk_tree_path_free (child_path);
- g_return_if_fail (path != NULL);
+
+ if (!path)
+ {
+ g_warning ("%s: The conversion of the child path to a GtkTreeModel sort path failed", G_STRLOC);
+ return;
+ }
gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model_sort), sort_iter, path);
gtk_tree_path_free (path);
@@ -2259,7 +2265,30 @@ gtk_tree_model_sort_build_level (GtkTreeModelSort *tree_model_sort,
if (gtk_tree_model_iter_next (tree_model_sort->child_model, &iter) == FALSE &&
i < length - 1)
{
- g_warning ("There is a discrepancy between the sort model and the child model.");
+ if (parent_level)
+ {
+ GtkTreePath *level;
+ gchar *str;
+
+ level = gtk_tree_model_sort_elt_get_path (parent_level,
+ parent_elt);
+ str = gtk_tree_path_to_string (level);
+ gtk_tree_path_free (level);
+
+ g_warning ("%s: There is a discrepancy between the sort model "
+ "and the child model. The child model is "
+ "advertising a wrong length for level %s:.",
+ G_STRLOC, str);
+ g_free (str);
+ }
+ else
+ {
+ g_warning ("%s: There is a discrepancy between the sort model "
+ "and the child model. The child model is "
+ "advertising a wrong length for the root level.",
+ G_STRLOC);
+ }
+
return;
}
}