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 566231 - Ther's no way to write a GKeyFile to a file in the GLib API
Ther's no way to write a GKeyFile to a file in the GLib API
Status: RESOLVED DUPLICATE of bug 309224
Product: glib
Classification: Platform
Component: general
2.16.x
Other All
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2009-01-01 21:00 UTC by Colomban Wendling
Modified: 2009-01-02 23:25 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Small patch implementing naive writing file capabilities to GKeyFile (1.97 KB, patch)
2009-01-01 21:06 UTC, Colomban Wendling
none Details | Review

Description Colomban Wendling 2009-01-01 21:00:11 UTC
According to the documentation, there's no way to directly write back a GKeyFile to its/another file. The only way seems now to write a custom function using g_key_file_to_data() and such as g_file_set_contents().

I think writing a GKeyFile to a file is common enough to consider adding a simple g_key_file_to_file() or such function directly in the GLib. Moreover, there's a function to load a configuration directly from a file, I think it would be more consistent to have a function to do the opposite.

I'll attach a small patch (based on 2.16.6) with a naive but functional implementation.

Regards,
Colomban W.
Comment 1 Colomban Wendling 2009-01-01 21:06:00 UTC
Created attachment 125601 [details] [review]
Small patch implementing naive writing file capabilities to GKeyFile

This patch is build against GLib 2.16.6 (Debian Lenny).
Comment 2 Matthias Clasen 2009-01-02 23:25:38 UTC

*** This bug has been marked as a duplicate of 309224 ***