[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: gaf.git: branch: master updated (1.7.1-20110619-288-g33fee83)
The branch, master has been updated
via 33fee83f110c86bf014bd4fb460bb38bae626a10 (commit)
from 6fac0c0f99b51a845f8ab7be2c358f703a54d61f (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
=========
Summary
=========
libgeda/include/i_vars_priv.h | 1 +
libgeda/include/libgeda/struct.h | 3 +++
libgeda/include/prototype_priv.h | 1 +
libgeda/lib/system-gafrc | 8 ++++++++
libgeda/src/f_basic.c | 5 +++--
libgeda/src/g_rc.c | 21 +++++++++++++++++++++
libgeda/src/g_register.c | 1 +
libgeda/src/i_vars.c | 4 ++++
libgeda/src/s_toplevel.c | 2 ++
9 files changed, 44 insertions(+), 2 deletions(-)
=================
Commit Messages
=================
commit 33fee83f110c86bf014bd4fb460bb38bae626a10
Author: Richard Barlow <richard@xxxxxxxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Add option to allow creation of backups to be disabled
When using a version control system the backup (example.sch~) files
created by libgeda become annoying. They can be ignored by most
VCSs however they still sit there and don't serve any purpose; any
mistakes can be recovered from a previous version.
This patch adds a configuration option "no-backup-files" which
suppresses the creation of backup files. It is disabled by default
so there is no change to the previous behaviour unless this option
is activated.
Closes-bug: lp-762894
:100644 100644 a1a4d4c... 1daea67... M libgeda/include/i_vars_priv.h
:100644 100644 d789975... 780da2a... M libgeda/include/libgeda/struct.h
:100644 100644 a6edf75... c07bd29... M libgeda/include/prototype_priv.h
:100644 100644 af9c5dc... 75e8fb5... M libgeda/lib/system-gafrc
:100644 100644 5ee61c2... 8743056... M libgeda/src/f_basic.c
:100644 100644 3ee8774... c63a5cc... M libgeda/src/g_rc.c
:100644 100644 21a16d0... 497d7b2... M libgeda/src/g_register.c
:100644 100644 35389a5... f08497b... M libgeda/src/i_vars.c
:100644 100644 940310a... 45597c4... M libgeda/src/s_toplevel.c
=========
Changes
=========
commit 33fee83f110c86bf014bd4fb460bb38bae626a10
Author: Richard Barlow <richard@xxxxxxxxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>
Add option to allow creation of backups to be disabled
When using a version control system the backup (example.sch~) files
created by libgeda become annoying. They can be ignored by most
VCSs however they still sit there and don't serve any purpose; any
mistakes can be recovered from a previous version.
This patch adds a configuration option "no-backup-files" which
suppresses the creation of backup files. It is disabled by default
so there is no change to the previous behaviour unless this option
is activated.
Closes-bug: lp-762894
diff --git a/libgeda/include/i_vars_priv.h b/libgeda/include/i_vars_priv.h
index a1a4d4c..1daea67 100644
--- a/libgeda/include/i_vars_priv.h
+++ b/libgeda/include/i_vars_priv.h
@@ -13,3 +13,4 @@ extern int default_attribute_promotion;
extern int default_promote_invisible;
extern int default_keep_invisible;
+extern int default_make_backup_files;
diff --git a/libgeda/include/libgeda/struct.h b/libgeda/include/libgeda/struct.h
index d789975..780da2a 100644
--- a/libgeda/include/libgeda/struct.h
+++ b/libgeda/include/libgeda/struct.h
@@ -503,6 +503,9 @@ struct st_toplevel {
/* controls if invisible attribs are kept and not deleted */
int keep_invisible;
+ /* controls the generation of backup (~) files */
+ int make_backup_files;
+
/* either window or limits */
int print_output_type;
diff --git a/libgeda/include/prototype_priv.h b/libgeda/include/prototype_priv.h
index a6edf75..c07bd29 100644
--- a/libgeda/include/prototype_priv.h
+++ b/libgeda/include/prototype_priv.h
@@ -31,6 +31,7 @@ SCM g_rc_attribute_promotion(SCM mode);
SCM g_rc_promote_invisible(SCM mode);
SCM g_rc_keep_invisible(SCM mode);
SCM g_rc_always_promote_attributes(SCM scmsymname);
+SCM g_rc_make_backup_files(SCM mode);
SCM g_rc_print_color_map (SCM scm_map);
/* g_register.c */
diff --git a/libgeda/lib/system-gafrc b/libgeda/lib/system-gafrc
index af9c5dc..75e8fb5 100644
--- a/libgeda/lib/system-gafrc
+++ b/libgeda/lib/system-gafrc
@@ -91,6 +91,14 @@
; End of attribute promotion keywords
;
+; make-backup-files
+;
+; Enable the creation of backup files (name.sch~) when saving a schematic.
+; It may be useful to disable this if your schematic is under version control
+; as you can always recover any mistakes from the revision history.
+;(make-backup-files "disabled")
+(make-backup-files "enabled")
+
;;;; Color maps
;; Load functions for handling color maps
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index 5ee61c2..8743056 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -389,8 +389,9 @@ int f_save(TOPLEVEL *toplevel, PAGE *page, const char *filename, GError **err)
dirname = g_path_get_dirname (real_filename);
only_filename = g_path_get_basename(real_filename);
- /* Do a backup if it's not an undo file backup and it was never saved. */
- if (page->saved_since_first_loaded == 0) {
+ /* Do a backup if it's not an undo file backup and it was never saved.
+ * Only do a backup if backup files are enabled */
+ if (page->saved_since_first_loaded == 0 && toplevel->make_backup_files == TRUE) {
if ( (g_file_test (real_filename, G_FILE_TEST_EXISTS)) &&
(!g_file_test(real_filename, G_FILE_TEST_IS_DIR)) )
{
diff --git a/libgeda/src/g_rc.c b/libgeda/src/g_rc.c
index 3ee8774..c63a5cc 100644
--- a/libgeda/src/g_rc.c
+++ b/libgeda/src/g_rc.c
@@ -1039,6 +1039,27 @@ SCM g_rc_always_promote_attributes(SCM attrlist)
return SCM_BOOL_T;
}
+/*! \brief Enable the creation of backup files when saving
+ * \par Function Description
+ * If enabled then a backup file, of the form 'example.sch~', is created when
+ * saving a file.
+ *
+ * \param [in] mode String. 'enabled' or 'disabled'
+ * \return Bool. False if mode is not a valid value; true if it is.
+ *
+ */
+SCM g_rc_make_backup_files(SCM mode)
+{
+ static const vstbl_entry mode_table[] = {
+ {TRUE , "enabled" },
+ {FALSE, "disabled"},
+ };
+
+ RETURN_G_RC_MODE("make-backup-files",
+ default_make_backup_files,
+ 2);
+}
+
extern COLOR print_colors[MAX_COLORS];
SCM g_rc_print_color_map (SCM scm_map)
diff --git a/libgeda/src/g_register.c b/libgeda/src/g_register.c
index 21a16d0..497d7b2 100644
--- a/libgeda/src/g_register.c
+++ b/libgeda/src/g_register.c
@@ -71,6 +71,7 @@ static struct gsubr_t libgeda_funcs[] = {
{ "promote-invisible", 1, 0, 0, g_rc_promote_invisible },
{ "keep-invisible", 1, 0, 0, g_rc_keep_invisible },
{ "always-promote-attributes",1, 0, 0, g_rc_always_promote_attributes },
+ { "make-backup-files", 1, 0, 0, g_rc_make_backup_files },
{ "print-color-map", 0, 1, 0, g_rc_print_color_map },
{ NULL, 0, 0, 0, NULL } };
diff --git a/libgeda/src/i_vars.c b/libgeda/src/i_vars.c
index 35389a5..f08497b 100644
--- a/libgeda/src/i_vars.c
+++ b/libgeda/src/i_vars.c
@@ -54,6 +54,8 @@ int default_attribute_promotion = TRUE;
int default_promote_invisible = FALSE;
int default_keep_invisible = TRUE;
+int default_make_backup_files = TRUE;
+
/*! \brief Initialize variables in TOPLEVEL object
* \par Function Description
* This function will initialize variables to default values.
@@ -72,6 +74,8 @@ void i_vars_libgeda_set(TOPLEVEL *toplevel)
toplevel->promote_invisible = default_promote_invisible;
toplevel->keep_invisible = default_keep_invisible;
+ toplevel->make_backup_files = default_make_backup_files;
+
/* copy the always_promote_attributes list from the default */
g_list_foreach(toplevel->always_promote_attributes, (GFunc) g_free, NULL);
g_list_free(toplevel->always_promote_attributes);
diff --git a/libgeda/src/s_toplevel.c b/libgeda/src/s_toplevel.c
index 940310a..45597c4 100644
--- a/libgeda/src/s_toplevel.c
+++ b/libgeda/src/s_toplevel.c
@@ -101,6 +101,8 @@ TOPLEVEL *s_toplevel_new (void)
toplevel->promote_invisible = FALSE;
toplevel->keep_invisible = FALSE;
+ toplevel->make_backup_files = TRUE;
+
toplevel->print_output_type = 0;
toplevel->print_output_capstyle = BUTT_CAP;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs