qofbook.cpp (gnucash-5.0.tar.bz2) | : | qofbook.cpp (gnucash-5.1.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 1270 | skipping to change at line 1270 | |||
} | } | |||
if (feature == nullptr || g_strcmp0 (feature->get<const char*>(), descr)) | if (feature == nullptr || g_strcmp0 (feature->get<const char*>(), descr)) | |||
{ | { | |||
qof_book_begin_edit (book); | qof_book_begin_edit (book); | |||
delete frame->set_path({GNC_FEATURES, key}, new KvpValue(g_strdup (descr ))); | delete frame->set_path({GNC_FEATURES, key}, new KvpValue(g_strdup (descr ))); | |||
qof_instance_set_dirty (QOF_INSTANCE (book)); | qof_instance_set_dirty (QOF_INSTANCE (book)); | |||
qof_book_commit_edit (book); | qof_book_commit_edit (book); | |||
} | } | |||
} | } | |||
std::vector<std::string> | FeatureSet | |||
qof_book_get_unknown_features (QofBook *book, const FeaturesTable& features) | qof_book_get_unknown_features (QofBook *book, const FeaturesTable& features) | |||
{ | { | |||
std::vector<std::string> rv; | FeatureSet rv; | |||
auto test_feature = [&](const KvpFrameImpl::map_type::value_type& feature) | auto test_feature = [&](const KvpFrameImpl::map_type::value_type& feature) | |||
{ | { | |||
if (features.find (feature.first) == features.end ()) | if (features.find (feature.first) == features.end ()) | |||
rv.push_back (feature.second->get<const char*>()); | rv.emplace_back (feature.first, feature.second->get<const char*>()); | |||
}; | }; | |||
auto frame = qof_instance_get_slots (QOF_INSTANCE (book)); | auto frame = qof_instance_get_slots (QOF_INSTANCE (book)); | |||
auto slot = frame->get_slot({GNC_FEATURES}); | auto slot = frame->get_slot({GNC_FEATURES}); | |||
if (slot != nullptr) | if (slot != nullptr) | |||
{ | { | |||
frame = slot->get<KvpFrame*>(); | frame = slot->get<KvpFrame*>(); | |||
std::for_each (frame->begin (), frame->end (), test_feature); | std::for_each (frame->begin (), frame->end (), test_feature); | |||
} | } | |||
return rv; | return rv; | |||
} | } | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 3 lines changed or added |