forked from AuroraMiddleware/gtk
file chooser: Use the right model when getting the selection
We don't need to make assumptions about which model is currently used since gtk_tree_selection_get_selection hands us the model. https://bugzilla.gnome.org/show_bug.cgi?id=761757
This commit is contained in:
parent
4c37719639
commit
811a9b21c1
@ -6266,10 +6266,11 @@ get_selected_file_info_from_file_list (GtkFileChooserWidget *impl,
|
|||||||
GtkTreeSelection *selection;
|
GtkTreeSelection *selection;
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
GFileInfo *info;
|
GFileInfo *info;
|
||||||
|
GtkTreeModel *model;
|
||||||
|
|
||||||
g_assert (!priv->select_multiple);
|
g_assert (!priv->select_multiple);
|
||||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view));
|
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->browse_files_tree_view));
|
||||||
if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
|
if (!gtk_tree_selection_get_selected (selection, &model, &iter))
|
||||||
{
|
{
|
||||||
*had_selection = FALSE;
|
*had_selection = FALSE;
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -6277,7 +6278,7 @@ get_selected_file_info_from_file_list (GtkFileChooserWidget *impl,
|
|||||||
|
|
||||||
*had_selection = TRUE;
|
*had_selection = TRUE;
|
||||||
|
|
||||||
info = _gtk_file_system_model_get_info (priv->browse_files_model, &iter);
|
info = _gtk_file_system_model_get_info (GTK_FILE_SYSTEM_MODEL (model), &iter);
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user