mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-features.cpp] backport gnc_features_set_unused from master
This commit is contained in:
parent
a078921a33
commit
1516bb18b0
@ -91,6 +91,23 @@ void gnc_features_set_used (QofBook *book, const gchar *feature)
|
||||
qof_book_set_feature (book, feature, iter->second.c_str());
|
||||
}
|
||||
|
||||
|
||||
void gnc_features_set_unused (QofBook *book, const gchar *feature)
|
||||
{
|
||||
g_return_if_fail (book);
|
||||
g_return_if_fail (feature);
|
||||
|
||||
/* Can't set an unknown feature */
|
||||
auto iter = features_table.find (feature);
|
||||
if (iter == features_table.end ())
|
||||
{
|
||||
PWARN("Tried to set unknown feature as unused.");
|
||||
return;
|
||||
}
|
||||
|
||||
qof_book_unset_feature (book, feature);
|
||||
}
|
||||
|
||||
gboolean gnc_features_check_used (QofBook *book, const gchar * feature)
|
||||
{
|
||||
return qof_book_test_feature (book, 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