gtk+ r21351 - in branches/gtk-2-12: . gtk
- From: matthiasc svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21351 - in branches/gtk-2-12: . gtk
- Date: Fri, 12 Sep 2008 02:33:16 +0000 (UTC)
Author: matthiasc
Date: Fri Sep 12 02:33:15 2008
New Revision: 21351
URL: http://svn.gnome.org/viewvc/gtk+?rev=21351&view=rev
Log:
Bug 538863 â Fixes assertion on entering empty folder
* gtk/gtkfilechooserdefault.c (browse_files_select_first_row): Don't
select the first row if the folder is empty.
Patch by Olle Bergkvist.
Modified:
branches/gtk-2-12/ChangeLog
branches/gtk-2-12/gtk/gtkfilechooserdefault.c
Modified: branches/gtk-2-12/gtk/gtkfilechooserdefault.c
==============================================================================
--- branches/gtk-2-12/gtk/gtkfilechooserdefault.c (original)
+++ branches/gtk-2-12/gtk/gtkfilechooserdefault.c Fri Sep 12 02:33:15 2008
@@ -6454,12 +6454,20 @@
browse_files_select_first_row (GtkFileChooserDefault *impl)
{
GtkTreePath *path;
+ GtkTreeIter dummy_iter;
+ GtkTreeModel *tree_model;
if (!impl->sort_model)
return;
path = gtk_tree_path_new_from_indices (0, -1);
gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
+ tree_model = gtk_tree_view_get_model (GTK_TREE_VIEW (impl->browse_files_tree_view));
+
+ /* If the list is empty, do nothing. */
+ if (gtk_tree_model_get_iter (tree_model, &dummy_iter, path))
+ gtk_tree_view_set_cursor (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, FALSE);
+
gtk_tree_path_free (path);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]