After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 590940 - Gtk::FileChooser::get_files() returns invalid list of Gio::File objects
Gtk::FileChooser::get_files() returns invalid list of Gio::File objects
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: giomm
unspecified
Other Linux
: Normal major
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2009-08-06 12:46 UTC by Tomasz Jankowski
Modified: 2010-03-26 09:50 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Sample code, which demonstrate problem (1.07 KB, text/plain)
2009-08-06 12:49 UTC, Tomasz Jankowski
  Details
Add TypeTraits for Gio::File (Fixes #590940) (2.00 KB, patch)
2009-08-07 15:36 UTC, Jonathon Jongsma
none Details | Review

Description Tomasz Jankowski 2009-08-06 12:46:35 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.
Comment 1 Tomasz Jankowski 2009-08-06 12:49:18 UTC
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`
Comment 2 Jonathon Jongsma 2009-08-06 22:24:50 UTC
It's actually because we need to specify a custom TypeTraits for Gio::File much like we do for Gio::Drive, Gio::Mount, etc.
Comment 3 Jonathon Jongsma 2009-08-07 15:36:47 UTC
Created attachment 140124 [details] [review]
Add TypeTraits for Gio::File (Fixes #590940)
Comment 4 Jonathon Jongsma 2010-01-06 05:30:46 UTC
Murray, I just noticed that this patch had not been applied yet, does it look ok to you?
Comment 5 Murray Cumming 2010-01-28 09:37:36 UTC
Looks OK.
Comment 6 Murray Cumming 2010-03-26 09:50:02 UTC
I have finally pushed this.