refs #757, materialize filtered data

* menu item / flag
* functions in view class
* some minor formatting
This commit is contained in:
Klaus Basan
2016-09-03 23:22:10 +02:00
committed by Roland Winklmeier
parent c848d7ca61
commit 610dba2028
7 changed files with 50 additions and 24 deletions

View File

@@ -499,6 +499,25 @@ namespace BlackGui
return this->m_container;
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
const ContainerType &CListModelBase<ObjectType, ContainerType, UseCompare>::containerFiltered() const
{
return this->m_containerFiltered;
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
const ContainerType &CListModelBase<ObjectType, ContainerType, UseCompare>::containerOrFilteredContainer() const
{
if (this->hasFilter())
{
return this->m_containerFiltered;
}
else
{
return this->m_container;
}
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::push_back(const ObjectType &object)
{
@@ -585,19 +604,6 @@ namespace BlackGui
return this->update(c, sort);
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
const ContainerType &CListModelBase<ObjectType, ContainerType, UseCompare>::containerOrFilteredContainer() const
{
if (this->hasFilter())
{
return this->m_containerFiltered;
}
else
{
return this->m_container;
}
}
template <typename ObjectType, typename ContainerType, bool UseCompare>
void CListModelBase<ObjectType, ContainerType, UseCompare>::updateFilteredContainer()
{

View File

@@ -37,7 +37,6 @@ class QMimeData;
class QModelIndex;
namespace BlackMisc { class CWorker; }
namespace BlackGui
{
namespace Models
@@ -205,6 +204,9 @@ namespace BlackGui
//! Used container data
const ContainerType &container() const;
//! Used container data
const ContainerType &containerFiltered() const;
//! Full container or cached filtered container as approproiate
const ContainerType &containerOrFilteredContainer() const;