mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-12-01 21:19:16 -06:00
[2/3][gnc-features.c] add & expose gnc_features_set_unused
same as gnc_features_set_used but removes feature
This commit is contained in:
parent
5dab33694f
commit
6070aecd69
@ -152,6 +152,27 @@ void gnc_features_set_used (QofBook *book, const gchar *feature)
|
||||
qof_book_set_feature (book, feature, description);
|
||||
}
|
||||
|
||||
|
||||
void gnc_features_set_unused (QofBook *book, const gchar *feature)
|
||||
{
|
||||
const gchar *description;
|
||||
|
||||
g_return_if_fail (book);
|
||||
g_return_if_fail (feature);
|
||||
|
||||
gnc_features_init();
|
||||
|
||||
/* Can't unset an unknown feature */
|
||||
description = g_hash_table_lookup (features_table, feature);
|
||||
if (!description)
|
||||
{
|
||||
PWARN("Tried to set unknown feature as unused.");
|
||||
return;
|
||||
}
|
||||
|
||||
qof_book_unset_feature (book, feature, description);
|
||||
}
|
||||
|
||||
struct CheckFeature
|
||||
{
|
||||
gchar const * checked_feature;
|
||||
|
@ -67,6 +67,13 @@ extern "C" {
|
||||
*/
|
||||
gchar *gnc_features_test_unknown (QofBook *book);
|
||||
|
||||
/**
|
||||
* Indicate that the current book does not use the given feature. This
|
||||
* will allow older versions of GnuCash that don't support this
|
||||
* feature to load this book.
|
||||
*/
|
||||
void gnc_features_set_unused (QofBook *book, const gchar *feature);
|
||||
|
||||
/**
|
||||
* Indicate that the current book uses the given feature. This will prevent
|
||||
* older versions of GnuCash that don't support this feature to refuse to load
|
||||
|
Loading…
Reference in New Issue
Block a user