[easytag] Use g_key_file_save_to_file()
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [easytag] Use g_key_file_save_to_file()
- Date: Mon, 12 Dec 2016 17:33:21 +0000 (UTC)
commit 176fd202d9d732201f476bc924970856ca0a50cd
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 3b4095d..9d6fa09 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]