summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ChangeLog.pre-2-104
-rw-r--r--ChangeLog.pre-2-84
-rw-r--r--gtk/gtkiconview.c18
4 files changed, 22 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 8f4e4d94dd..ca1f694f65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2005-08-15 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkiconview.c (gtk_icon_view_select_path)
+ (gtk_icon_view_scroll_to_path): Handle paths of depth 0
+ gracefully. (#312796, Jonathan Blandford)
+
* tests/testtoolbar.c: Add some more tests for menu placement.
* gtk/gtkmenutoolbutton.c (menu_position_func):
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 8f4e4d94dd..ca1f694f65 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,5 +1,9 @@
2005-08-15 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkiconview.c (gtk_icon_view_select_path)
+ (gtk_icon_view_scroll_to_path): Handle paths of depth 0
+ gracefully. (#312796, Jonathan Blandford)
+
* tests/testtoolbar.c: Add some more tests for menu placement.
* gtk/gtkmenutoolbutton.c (menu_position_func):
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 8f4e4d94dd..ca1f694f65 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,5 +1,9 @@
2005-08-15 Matthias Clasen <mclasen@redhat.com>
+ * gtk/gtkiconview.c (gtk_icon_view_select_path)
+ (gtk_icon_view_scroll_to_path): Handle paths of depth 0
+ gracefully. (#312796, Jonathan Blandford)
+
* tests/testtoolbar.c: Add some more tests for menu placement.
* gtk/gtkmenutoolbutton.c (menu_position_func):
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 30360fd3ce..f589fe5153 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -3917,15 +3917,16 @@ gtk_icon_view_scroll_to_path (GtkIconView *icon_view,
gfloat row_align,
gfloat col_align)
{
- GtkIconViewItem *item;
+ GtkIconViewItem *item = NULL;
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
g_return_if_fail (path != NULL);
g_return_if_fail (row_align >= 0.0 && row_align <= 1.0);
g_return_if_fail (col_align >= 0.0 && col_align <= 1.0);
- item = g_list_nth (icon_view->priv->items,
- gtk_tree_path_get_indices(path)[0])->data;
+ if (gtk_tree_path_get_depth (path) > 0)
+ item = g_list_nth_data (icon_view->priv->items,
+ gtk_tree_path_get_indices(path)[0]);
if (!item)
return;
@@ -4979,17 +4980,18 @@ void
gtk_icon_view_select_path (GtkIconView *icon_view,
GtkTreePath *path)
{
- GList *l;
+ GtkIconViewItem *item = NULL;
g_return_if_fail (GTK_IS_ICON_VIEW (icon_view));
g_return_if_fail (icon_view->priv->model != NULL);
g_return_if_fail (path != NULL);
- l = g_list_nth (icon_view->priv->items,
- gtk_tree_path_get_indices(path)[0]);
+ if (gtk_tree_path_get_depth (path) > 0)
+ item = g_list_nth_data (icon_view->priv->items,
+ gtk_tree_path_get_indices(path)[0]);
- if (l != NULL)
- gtk_icon_view_select_item (icon_view, l->data);
+ if (item)
+ gtk_icon_view_select_item (icon_view, item);
}
/**