[easytag/wip/future-gtk: 81/81] Use g_key_file_save_to_file()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag/wip/future-gtk: 81/81] Use g_key_file_save_to_file()
- Date: Fri, 15 Jan 2016 18:48:36 +0000 (UTC)
commit 5210a648c58259f1258c8aca4a8c68ec3f1f9a2a
Author: David King <amigadave amigadave com>
Date: Fri Jan 15 18:46:47 2016 +0000
Use g_key_file_save_to_file()
Simplify the saving of window state.
src/application_window.c | 8 +-------
1 files changed, 1 insertions(+), 7 deletions(-)
---
diff --git a/src/application_window.c b/src/application_window.c
index b7e2c6a..a3cabf5 100644
--- a/src/application_window.c
+++ b/src/application_window.c
@@ -112,8 +112,6 @@ save_state (EtApplicationWindow *self)
EtApplicationWindowPrivate *priv;
gchar *path;
GKeyFile *keyfile;
- gchar *buffer;
- gsize length;
GError *error = NULL;
priv = et_application_window_get_instance_private (self);
@@ -150,16 +148,12 @@ save_state (EtApplicationWindow *self)
g_key_file_set_integer (keyfile, "EtApplicationWindow", "paned_position",
priv->paned_position);
- /* TODO; Use g_key_file_save_to_file() in GLib 2.40. */
- buffer = g_key_file_to_data (keyfile, &length, NULL);
-
- if (!g_file_set_contents (path, buffer, length, &error))
+ if (!g_key_file_save_to_file (keyfile, path, &error))
{
g_warning ("Error saving window state: %s", error->message);
g_error_free (error);
}
- g_free (buffer);
g_free (path);
g_key_file_free (keyfile);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]