GNOME Bugzilla – Bug 590940
Gtk::FileChooser::get_files() returns invalid list of Gio::File objects
Last modified: 2010-03-26 09:50:02 UTC
When I get list of selected files from file chooser dialog using function Gtk::FileChooser::get_files() program displays this warning: (program:14357): glibmm-WARNING **: Failed to wrap object of type 'GLocalFile'. Hint: this error is commonly caused by failing to call a library init() function. for each file in the files list. I use Gtkmm 2.17.2 (GTK+ 2.17.6) on Ubuntu 9.10.
Created attachment 140017 [details] Sample code, which demonstrate problem Run program, select few files and close chooser dialog. This is full output when I selected 3 files: goofy@goofy-laptop:~/Pulpit$ ./program (program:14357): glibmm-WARNING **: Failed to wrap object of type 'GLocalFile'. Hint: this error is commonly caused by failing to call a library init() function. (program:14357): glibmm-WARNING **: Failed to wrap object of type 'GLocalFile'. Hint: this error is commonly caused by failing to call a library init() function. (program:14357): glibmm-WARNING **: Failed to wrap object of type 'GLocalFile'. Hint: this error is commonly caused by failing to call a library init() function. Segmentation fault (core dumped) goofy@goofy-laptop:~/Pulpit$ I compile code with command: g++ kod.cpp -o program `pkg-config gtkmm-2.4 giomm-2.4 --libs --cflags`
It's actually because we need to specify a custom TypeTraits for Gio::File much like we do for Gio::Drive, Gio::Mount, etc.
Created attachment 140124 [details] [review] Add TypeTraits for Gio::File (Fixes #590940)
Murray, I just noticed that this patch had not been applied yet, does it look ok to you?
Looks OK.
I have finally pushed this.