SF.net SVN: geany:[5937] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Tue Sep 20 14:29:46 UTC 2011


Revision: 5937
          http://geany.svn.sourceforge.net/geany/?rev=5937&view=rev
Author:   ntrel
Date:     2011-09-20 14:29:46 +0000 (Tue, 20 Sep 2011)
Log Message:
-----------
Rename use_safe_file_saving various pref to use_atomic_file_saving 
as it's not 'safe'. Use old pref if new one is missing for 
compatibility with Geany <= 0.20.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/keyfile.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2011-09-19 18:54:29 UTC (rev 5936)
+++ trunk/ChangeLog	2011-09-20 14:29:46 UTC (rev 5937)
@@ -1,3 +1,11 @@
+2011-09-20  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>
+
+ * src/keyfile.c:
+   Rename use_safe_file_saving various pref to use_atomic_file_saving 
+   as it's not 'safe'. Use old pref if new one is missing for 
+   compatibility with Geany <= 0.20.
+
+
 2011-09-17  Frank Lanitz  <frlan at frank.uvena.de>
 
  * po/fa.po, THANKS, src/about.c:

Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c	2011-09-19 18:54:29 UTC (rev 5936)
+++ trunk/src/keyfile.c	2011-09-20 14:29:46 UTC (rev 5937)
@@ -92,8 +92,10 @@
 static gint session_notebook_page;
 static gint hpan_position;
 static gint vpan_position;
+static const gchar atomic_file_saving_key[] = "use_atomic_file_saving";
 
 static GPtrArray *keyfile_groups = NULL;
+
 GPtrArray *pref_groups = NULL;
 
 
@@ -193,7 +195,7 @@
 	stash_group_add_boolean(group, &editor_prefs.complete_snippets_whilst_editing,
 		"complete_snippets_whilst_editing", FALSE);
 	stash_group_add_boolean(group, &file_prefs.use_safe_file_saving,
-		"use_safe_file_saving", FALSE);
+		atomic_file_saving_key, FALSE);
 	stash_group_add_boolean(group, &file_prefs.gio_unsafe_save_backup,
 		"gio_unsafe_save_backup", FALSE);
 	stash_group_add_boolean(group, &file_prefs.use_gio_unsafe_file_saving,
@@ -664,12 +666,20 @@
 }
 
 
+/* note: new settings should be added in init_pref_groups() */
 static void load_dialog_prefs(GKeyFile *config)
 {
 	gchar *tmp_string, *tmp_string2;
 	const gchar *default_charset = NULL;
 
-	/* new settings should be added in init_pref_groups() */
+	/* compatibility with Geany 0.20 */
+	if (!g_key_file_has_key(config, PACKAGE, atomic_file_saving_key, NULL))
+	{
+		g_key_file_set_boolean(config, PACKAGE, atomic_file_saving_key,
+			utils_get_setting_boolean(config, PACKAGE, "use_safe_file_saving", FALSE));
+	}
+	
+	/* read stash prefs */
 	settings_action(config, SETTING_READ);
 
 	/* general */

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Commits mailing list