summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-11-23 19:26:31 +0100
committerraveit65 <[email protected]>2023-04-22 10:41:13 +0200
commitda643512befc61c0846bb399856e658630c5306d (patch)
tree7349c5555ebe8a0cbb7903d0132ab5cfd508089e
parent92c9a82105b222a934e994a87738673351ad33ee (diff)
downloadmate-session-manager-da643512befc61c0846bb399856e658630c5306d.tar.bz2
mate-session-manager-da643512befc61c0846bb399856e658630c5306d.tar.xz
g_key_file_save_to_file () is available from glib 2.40
-rw-r--r--capplet/gsp-app.c2
-rw-r--r--capplet/gsp-keyfile.c33
-rw-r--r--capplet/gsp-keyfile.h4
3 files changed, 1 insertions, 38 deletions
diff --git a/capplet/gsp-app.c b/capplet/gsp-app.c
index e823a53..6c2250a 100644
--- a/capplet/gsp-app.c
+++ b/capplet/gsp-app.c
@@ -490,7 +490,7 @@ _gsp_app_save (gpointer data)
}
_gsp_ensure_user_autostart_dir ();
- if (gsp_key_file_to_file (keyfile, priv->path, NULL)) {
+ if (g_key_file_save_to_file (keyfile, priv->path, NULL)) {
priv->skip_next_monitor_event = TRUE;
_gsp_app_save_done_success (app);
} else {
diff --git a/capplet/gsp-keyfile.c b/capplet/gsp-keyfile.c
index 434ec97..260c1de 100644
--- a/capplet/gsp-keyfile.c
+++ b/capplet/gsp-keyfile.c
@@ -43,39 +43,6 @@ gsp_key_file_populate (GKeyFile *keyfile)
"/bin/false");
}
-//FIXME: kill this when bug #309224 is fixed
-gboolean
-gsp_key_file_to_file (GKeyFile *keyfile,
- const gchar *path,
- GError **error)
-{
- GError *write_error;
- gchar *data;
- gsize length;
- gboolean res;
-
- g_return_val_if_fail (keyfile != NULL, FALSE);
- g_return_val_if_fail (path != NULL, FALSE);
-
- write_error = NULL;
- data = g_key_file_to_data (keyfile, &length, &write_error);
-
- if (write_error) {
- g_propagate_error (error, write_error);
- return FALSE;
- }
-
- res = g_file_set_contents (path, data, length, &write_error);
- g_free (data);
-
- if (write_error) {
- g_propagate_error (error, write_error);
- return FALSE;
- }
-
- return res;
-}
-
gboolean
gsp_key_file_get_boolean (GKeyFile *keyfile,
const gchar *key,
diff --git a/capplet/gsp-keyfile.h b/capplet/gsp-keyfile.h
index 7838017..ed7a0c9 100644
--- a/capplet/gsp-keyfile.h
+++ b/capplet/gsp-keyfile.h
@@ -38,10 +38,6 @@ extern "C" {
void gsp_key_file_populate (GKeyFile *keyfile);
-gboolean gsp_key_file_to_file (GKeyFile *keyfile,
- const gchar *path,
- GError **error);
-
gboolean gsp_key_file_get_boolean (GKeyFile *keyfile,
const gchar *key,
gboolean default_value);