mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Merge Richard Cohen's 'minor-options-fixes' into master.
This commit is contained in:
commit
352ab8a0e5
@ -143,8 +143,6 @@ GncOptionGncOwnerValue::serialize() const noexcept
|
||||
return retval;
|
||||
}
|
||||
|
||||
using GncItem = std::pair<QofIdTypeConst, GncGUID>;
|
||||
|
||||
static GncItem
|
||||
make_gnc_item(const QofInstance* inst)
|
||||
{
|
||||
@ -176,14 +174,6 @@ qof_instance_from_gnc_item(const GncItem& item)
|
||||
return static_cast<QofInstance*>(qof_collection_lookup_entity(coll, &guid));
|
||||
}
|
||||
|
||||
static bool
|
||||
operator!=(const GncItem& left, const GncItem& right)
|
||||
{
|
||||
auto [ltype, lguid]{left};
|
||||
auto [rtype, rguid]{right};
|
||||
return strcmp(rtype, ltype) && !guid_equal(&rguid, &lguid);
|
||||
}
|
||||
|
||||
GncOptionQofInstanceValue::GncOptionQofInstanceValue(
|
||||
const char* section, const char* name,
|
||||
const char* key, const char* doc_string,
|
||||
@ -233,6 +223,12 @@ GncOptionQofInstanceValue::reset_default_value()
|
||||
m_value = m_default_value;
|
||||
}
|
||||
|
||||
static bool
|
||||
operator==(const GncGUID& l, const GncGUID& r)
|
||||
{
|
||||
return guid_equal(&l, &r);
|
||||
}
|
||||
|
||||
bool
|
||||
GncOptionQofInstanceValue::is_changed() const noexcept
|
||||
{
|
||||
@ -447,12 +443,6 @@ GncOptionAccountListValue::get_default_value() const
|
||||
return retval;
|
||||
}
|
||||
|
||||
static bool
|
||||
operator==(const GncGUID& l, const GncGUID& r)
|
||||
{
|
||||
return guid_equal(&l, &r);
|
||||
}
|
||||
|
||||
bool
|
||||
GncOptionAccountListValue::is_changed() const noexcept
|
||||
{
|
||||
|
@ -150,7 +150,7 @@ GncOptionSection::remove_option(const char* name)
|
||||
[name](const auto& option) -> bool
|
||||
{
|
||||
return option.get_name() == name;
|
||||
}));
|
||||
}), m_options.end());
|
||||
}
|
||||
|
||||
const GncOption*
|
||||
@ -355,8 +355,9 @@ GncOptionDB::register_callback(GncOptionDBChangeCallback cb, void* data)
|
||||
void
|
||||
GncOptionDB::unregister_callback(size_t id)
|
||||
{
|
||||
std::remove_if(m_callbacks.begin(), m_callbacks.end(),
|
||||
[id](auto& cb)->bool { return cb.m_id == id; });
|
||||
m_callbacks.erase(std::remove_if(m_callbacks.begin(), m_callbacks.end(),
|
||||
[id](auto& cb)->bool { return cb.m_id == id; }),
|
||||
m_callbacks.end());
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user