mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
refs #900, filtered flag for containerOrFilteredContainer
more reliable than other approaches
This commit is contained in:
committed by
Mathew Sutcliffe
parent
6999a97f73
commit
30ef3eedf9
@@ -519,14 +519,16 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
template <typename ObjectType, typename ContainerType, bool UseCompare>
|
||||
const ContainerType &CListModelBase<ObjectType, ContainerType, UseCompare>::containerOrFilteredContainer() const
|
||||
const ContainerType &CListModelBase<ObjectType, ContainerType, UseCompare>::containerOrFilteredContainer(bool *filtered) const
|
||||
{
|
||||
if (this->hasFilter())
|
||||
{
|
||||
if (filtered) { *filtered = true; }
|
||||
return this->m_containerFiltered;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (filtered) { *filtered = false; }
|
||||
return this->m_container;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,7 +205,7 @@ namespace BlackGui
|
||||
const ContainerType &containerFiltered() const;
|
||||
|
||||
//! Full container or cached filtered container as approproiate
|
||||
const ContainerType &containerOrFilteredContainer() const;
|
||||
const ContainerType &containerOrFilteredContainer(bool *filtered = nullptr) const;
|
||||
|
||||
//! Simple set of data in container, using class is responsible for firing signals etc.
|
||||
//! \sa sendDataChanged
|
||||
|
||||
@@ -936,10 +936,10 @@ namespace BlackGui
|
||||
}
|
||||
|
||||
template <class ModelClass, class ContainerType, class ObjectType>
|
||||
const ContainerType &CViewBase<ModelClass, ContainerType, ObjectType>::containerOrFilteredContainer() const
|
||||
const ContainerType &CViewBase<ModelClass, ContainerType, ObjectType>::containerOrFilteredContainer(bool *filtered) const
|
||||
{
|
||||
Q_ASSERT(this->m_model);
|
||||
return this->m_model->containerOrFilteredContainer();
|
||||
return this->m_model->containerOrFilteredContainer(filtered);
|
||||
}
|
||||
|
||||
template <class ModelClass, class ContainerType, class ObjectType>
|
||||
|
||||
@@ -549,7 +549,7 @@ namespace BlackGui
|
||||
const ContainerType &container() const;
|
||||
|
||||
//! \copydoc BlackGui::Models::CListModelBase::containerOrFilteredContainer
|
||||
const ContainerType &containerOrFilteredContainer() const;
|
||||
const ContainerType &containerOrFilteredContainer(bool *filtered = nullptr) const;
|
||||
|
||||
//! \name Selection model interface
|
||||
//! @{
|
||||
|
||||
Reference in New Issue
Block a user