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 613477 - Return value obsolete: Glib::KeyFile::load_from_file
Return value obsolete: Glib::KeyFile::load_from_file
Status: RESOLVED FIXED
Product: glibmm
Classification: Bindings
Component: general
2.22.x
Other Linux
: Normal minor
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2010-03-21 11:06 UTC by rob
Modified: 2010-06-08 15:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description rob 2010-03-21 11:06:43 UTC
The return value of Glib::KeyFile::load_from_file will never be false, instead an exception will be thrown if:
- File doesn't exist.
- File access is denied.
- File is accessible but not a valid KeyFile.

It returns true on success as expected but the application will terminate on fail if the exception is not caught.

Fixing has to be delayed to an ABI-breaking release.
Comment 1 Murray Cumming 2010-06-08 15:40:01 UTC
I fixed this in the glibmm-3maybe branch, with this commit:

2010-06-08  Murray Cumming  <murrayc@murrayc.com>

	KeyFile: Remove bool return from methods that throw on error anyway.

	* glib/src/keyfile.[hg|ccg]: load_from_file(), load_from_data(),
    load_from_data_dirs(): Change the bool return type to void because they
    throw exceptions anyway. This fixes bug #613477 (Rob)

Thanks. If you find more like this, a patch would be welcome.