From 1344ea67e7af93e78bcd7eb38eadc4313633c303 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 27 Jul 2019 17:48:42 +0100 Subject: [PATCH] Create a function to remove the registered preference call backs setup in gnc-prefs-utils.c --- libgnucash/app-utils/gnc-prefs-utils.c | 16 ++++++++++++++++ libgnucash/app-utils/gnc-prefs-utils.h | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/libgnucash/app-utils/gnc-prefs-utils.c b/libgnucash/app-utils/gnc-prefs-utils.c index 0ea96b5bac..c74405b703 100644 --- a/libgnucash/app-utils/gnc-prefs-utils.c +++ b/libgnucash/app-utils/gnc-prefs-utils.c @@ -124,3 +124,19 @@ void gnc_prefs_init (void) file_compression_changed_cb, NULL); } + +void +gnc_prefs_remove_registered (void) +{ + // remove the registered pref call backs above + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_DAYS, + file_retain_changed_cb, NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_NEVER, + file_retain_type_changed_cb, NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_DAYS, + file_retain_type_changed_cb, NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_RETAIN_TYPE_FOREVER, + file_retain_type_changed_cb, NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_FILE_COMPRESSION, + file_compression_changed_cb, NULL); +} diff --git a/libgnucash/app-utils/gnc-prefs-utils.h b/libgnucash/app-utils/gnc-prefs-utils.h index 49f7ad03b2..1eaf935eb9 100644 --- a/libgnucash/app-utils/gnc-prefs-utils.h +++ b/libgnucash/app-utils/gnc-prefs-utils.h @@ -47,6 +47,11 @@ */ void gnc_prefs_init (void); +/** This function is called to remove the registered preference + * call backs setup in this file + */ +void gnc_prefs_remove_registered (void); + #endif /* GNC_PREFS_UTILS_H_ */ /** @} */ /** @} */