C++ gtkmm: FileChooserDialog not working with any drives

246 views Asked by At

How do I browse local or especially network drives using Gtk::FileChooserDialog? I see all the drives including the network drives (I want to browse these), but when I click it, nothing happens or I am redirected to different folder.

Gtk::FileChooserDialog dialog("Please choose a folder",Gtk::FILE_CHOOSER_ACTION_SELECT_FOLDER);
dialog.set_transient_for(*this);
int result = dialog.run();
//go on with other code

Only browsing the shortcuts like Documents, Downloads etc. works. I'm using Windows 7 with gtkmm 3.0 if that matters. From explorer or cmd all drives are accessible of course.

EDIT: The behavior can be reproduced by compiling this code under Windows: https://developer.gnome.org/gtkmm-tutorial/stable/sec-dialogs-filechooserdialog.html.en and trying to browse drive C for example.

Can anyone manage to reproduce the same behavior? Thx

1

There are 1 answers

0
C Chorche On BEST ANSWER

Found a cause.

This is actually a bug (https://gitlab.gnome.org/GNOME/gtk/issues/170) reported few days before. The solution is to update your glib2 with the fix (https://github.com/Alexpux/MINGW-packages/blob/master/mingw-w64-glib2/W32-gstdio-Dont-try-to-get-reparse-tag-uncondition.patch). Or wait/upgrade to glib 2.56.2.

After applying the fix, everything works at it should.