mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 20:40:29 +08:00
refs #526, added removeIf/replaceOrAdd to viewbase
This commit is contained in:
@@ -393,6 +393,27 @@ namespace BlackGui
|
|||||||
//! Remove selected rows
|
//! Remove selected rows
|
||||||
int removeSelectedRows();
|
int removeSelectedRows();
|
||||||
|
|
||||||
|
//! \copydoc BlackMisc::CContainerBase::removeIf
|
||||||
|
template <class K0, class V0, class... KeysValues>
|
||||||
|
int removeIf(K0 k0, V0 v0, KeysValues... keysValues)
|
||||||
|
{
|
||||||
|
if (this->rowCount() < 1) { return 0; }
|
||||||
|
ContainerType copy(container());
|
||||||
|
int r = copy.removeIf(k0, v0, keysValues...);
|
||||||
|
if (r < 1) { return 0; }
|
||||||
|
this->updateContainerMaybeAsync(copy);
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
|
//! \copydoc BlackMisc::CSequence::replaceOrAdd
|
||||||
|
template <class K1, class V1>
|
||||||
|
void replaceOrAdd(K1 key1, V1 value1, const ObjectType &replacement)
|
||||||
|
{
|
||||||
|
ContainerType copy(container());
|
||||||
|
copy.replaceOrAdd(key1, value1, replacement);
|
||||||
|
this->updateContainerMaybeAsync(copy);
|
||||||
|
}
|
||||||
|
|
||||||
//! Row count
|
//! Row count
|
||||||
int rowCount() const;
|
int rowCount() const;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user