GtkFileChooserButton says "None" when remote files are selected
Selecting a remote file won't update the button's label when it should. Tested with GTK 3.24.8. (Haven't had the time to root cause the problem yet)
#include <gtk/gtk.h>
static void
file_set_cb (GtkFileChooser *chooser,
gpointer user_data)
{
g_message ("filename: %s", gtk_file_chooser_get_filename (chooser));
g_message ("uri: %s", gtk_file_chooser_get_uri (chooser));
}
int main (int argc, char **argv)
{
GtkWidget *win, *button;
gtk_init (&argc, &argv);
win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
button = gtk_file_chooser_button_new ("Select remote file", GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_file_chooser_button_set_width_chars (GTK_FILE_CHOOSER_BUTTON (button), 30);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (button), FALSE);
g_signal_connect (G_OBJECT (button), "file-set",
G_CALLBACK (file_set_cb), NULL);
gtk_container_add (GTK_CONTAINER (win), button);
gtk_widget_show_all (win);
gtk_main ();
return 0;
}