Kaydet (Commit) 3a3d8815 authored tarafından Nick Treleaven's avatar Nick Treleaven

Add gio_unsafe_save_backup hidden pref (patch by Lex Trotman,

thanks).



git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5430 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 7dbb4359
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
* src/interface.c, doc/geany.txt, doc/geany.html, geany.glade: * src/interface.c, doc/geany.txt, doc/geany.html, geany.glade:
Don't use 'Enable' in pref labels when unnecessary. Don't use 'Enable' in pref labels when unnecessary.
Rename XML/HTML tag autocompletion -> auto-closing. Rename XML/HTML tag autocompletion -> auto-closing.
* src/keyfile.c, src/document.c, src/document.h, doc/geany.txt,
doc/geany.html:
Add gio_unsafe_save_backup hidden pref (patch by Lex Trotman,
thanks).
2010-11-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> 2010-11-22 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
......
...@@ -4959,6 +4959,11 @@ The better approach would be to ensure your ...@@ -4959,6 +4959,11 @@ The better approach would be to ensure your
disk won't run out of free space.</td> disk won't run out of free space.</td>
<td>false</td> <td>false</td>
</tr> </tr>
<tr><td>gio_unsafe_save_backup</td>
<td>Make a backup when using GIO unsafe file
saving. Backup is named <cite>filename~</cite>.</td>
<td>false</td>
</tr>
<tr><td><strong>Search related</strong></td> <tr><td><strong>Search related</strong></td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
...@@ -6367,7 +6372,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p> ...@@ -6367,7 +6372,7 @@ USE OR PERFORMANCE OF THIS SOFTWARE.</p>
<div class="footer"> <div class="footer">
<hr class="footer" /> <hr class="footer" />
<a class="reference" href="geany.txt">View document source</a>. <a class="reference" href="geany.txt">View document source</a>.
Generated on: 2010-11-23 13:39 UTC. Generated on: 2010-11-23 16:18 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div> </div>
......
...@@ -4225,6 +4225,8 @@ use_safe_file_saving Defines the mode how Geany saves files to f ...@@ -4225,6 +4225,8 @@ use_safe_file_saving Defines the mode how Geany saves files to f
break things seriously. break things seriously.
The better approach would be to ensure your The better approach would be to ensure your
disk won't run out of free space. disk won't run out of free space.
gio_unsafe_save_backup Make a backup when using GIO unsafe file false
saving. Backup is named `filename~`.
**Search related** **Search related**
find_selection_type See `Find selection`_. 0 find_selection_type See `Find selection`_. 0
**Build Menu related** **Build Menu related**
......
...@@ -1721,7 +1721,7 @@ static gchar *write_data_to_disk(const gchar *locale_filename, ...@@ -1721,7 +1721,7 @@ static gchar *write_data_to_disk(const gchar *locale_filename,
/* Use GIO API to save file (GVFS-safe) */ /* Use GIO API to save file (GVFS-safe) */
fp = g_file_new_for_path(locale_filename); fp = g_file_new_for_path(locale_filename);
g_file_replace_contents(fp, data, len, NULL, FALSE, g_file_replace_contents(fp, data, len, NULL, file_prefs.gio_unsafe_save_backup,
G_FILE_CREATE_NONE, NULL, NULL, &error); G_FILE_CREATE_NONE, NULL, NULL, &error);
g_object_unref(fp); g_object_unref(fp);
#else #else
......
...@@ -60,6 +60,7 @@ typedef struct GeanyFilePrefs ...@@ -60,6 +60,7 @@ typedef struct GeanyFilePrefs
gboolean cmdline_new_files; /* New file if command-line filename doesn't exist */ gboolean cmdline_new_files; /* New file if command-line filename doesn't exist */
gboolean use_safe_file_saving; gboolean use_safe_file_saving;
gboolean ensure_convert_new_lines; gboolean ensure_convert_new_lines;
gboolean gio_unsafe_save_backup;
} }
GeanyFilePrefs; GeanyFilePrefs;
......
...@@ -189,6 +189,8 @@ static void init_pref_groups(void) ...@@ -189,6 +189,8 @@ static void init_pref_groups(void)
"complete_snippets_whilst_editing", FALSE); "complete_snippets_whilst_editing", FALSE);
stash_group_add_boolean(group, &file_prefs.use_safe_file_saving, stash_group_add_boolean(group, &file_prefs.use_safe_file_saving,
"use_safe_file_saving", FALSE); "use_safe_file_saving", FALSE);
stash_group_add_boolean(group, &file_prefs.gio_unsafe_save_backup,
"gio_unsafe_save_backup", FALSE);
/* for backwards-compatibility */ /* for backwards-compatibility */
stash_group_add_integer(group, &editor_prefs.indentation->hard_tab_width, stash_group_add_integer(group, &editor_prefs.indentation->hard_tab_width,
"indent_hard_tab_width", 8); "indent_hard_tab_width", 8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment