file chooser button: Make dnd work as expected

Update the button contents when accepting a drop.

https://bugzilla.gnome.org/show_bug.cgi?id=743451
This commit is contained in:
Matthias Clasen 2015-01-28 22:36:47 -05:00
parent 1c8b77637a
commit 0367f785ef

View File

@ -1126,8 +1126,7 @@ dnd_select_folder_get_info_cb (GCancellable *cancellable,
data->selected =
(((data->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER && is_folder) ||
(data->action == GTK_FILE_CHOOSER_ACTION_OPEN && !is_folder)) &&
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (data->button->priv->dialog),
data->file, NULL));
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (data->button), data->file, NULL));
}
else
data->selected = FALSE;
@ -1217,8 +1216,7 @@ gtk_file_chooser_button_drag_data_received (GtkWidget *widget,
case TEXT_PLAIN:
text = (char*) gtk_selection_data_get_text (data);
file = g_file_new_for_uri (text);
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (priv->dialog), file,
NULL);
gtk_file_chooser_select_file (GTK_FILE_CHOOSER (priv->dialog), file, NULL);
g_object_unref (file);
g_free (text);
g_signal_emit (button, file_chooser_button_signals[FILE_SET], 0);