digiKam
|
Public Types | |
enum | FilterBehavior { SimpleFiltering , FullFiltering , StrictFiltering } |
enum | MatchResult { NoMatch = 0 , DirectMatch , ParentMatch , ChildMatch , SpecialMatch } |
Public Slots | |
void | setSearchTextSettings (const SearchTextSettings &settings) |
Signals | |
void | hasSearchResult (bool hasResult) |
void | searchTextSettingsAboutToChange (bool searched, bool willSearch) |
void | searchTextSettingsChanged (bool wasSearching, bool searched) |
void | signalFilterChanged () |
Static Public Member Functions | |
template<typename T > | |
static int | compareByOrder (const T &a, const T &b, Qt::SortOrder sortOrder) |
static int | compareByOrder (int compareResult, Qt::SortOrder sortOrder) |
template<typename T > | |
static int | compareValue (const T &a, const T &b) |
Protected Slots | |
void | slotAlbumRenamed (Album *album) |
void | slotAlbumsHaveBeenUpdated (int type) |
Protected Member Functions | |
bool | filterAcceptsRow (int source_row, const QModelIndex &source_parent) const override |
bool | lessThan (const QModelIndex &left, const QModelIndex &right) const override |
bool | matches (Album *album) const override |
MatchResult | matchResult (Album *album) const |
void | setSourceModel (QAbstractItemModel *const model) override |
Protected Attributes | |
QPointer< AlbumFilterModel > | m_chainedModel |
FilterBehavior | m_filterBehavior |
bool | m_filterChecked |
bool | m_filterPartiallyChecked |
QObject * | m_parent |
SearchTextSettings | m_settings |
Filter model for checkable album models that allows more filtering options based on check state.
|
inherited |
|
inherited |
|
explicit |
|
inherited |
Convenience methods.
References Digikam::AbstractAlbumModel::retrieveAlbum().
Referenced by Digikam::AlbumTreeView::albumForIndex(), Digikam::DateTreeView::albumForIndex(), Digikam::TagTreeView::albumForIndex(), Digikam::TagFolderView::contextMenuEvent(), Digikam::AlbumTreeView::currentAlbum(), Digikam::DateTreeView::currentAlbum(), Digikam::SearchTreeView::currentAlbum(), Digikam::TagTreeView::currentAlbum(), Digikam::AbstractAlbumTreeView::doSaveState(), Digikam::AlbumFilterModel::lessThan(), Digikam::AlbumFilterModel::matchResult(), Digikam::AbstractAlbumTreeView::mousePressEvent(), and Digikam::AbstractAlbumTreeView::slotCurrentChanged().
|
inlinestaticinherited |
|
inlinestaticinherited |
Takes a typical result from a compare method (0 is equal, -1 is less than, 1 is greater than) and applies the given sort order to it.
Referenced by Digikam::AlbumFilterModel::lessThan().
|
inlinestaticinherited |
Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan.
|
inherited |
References Digikam::ApplicationSettings::ByDate, Digikam::ApplicationSettings::ByFolder, Digikam::PAlbum::category(), Digikam::Album::DATE, Digikam::PAlbum::date(), Digikam::ApplicationSettings::getAlbumSortRole(), Digikam::ApplicationSettings::instance(), Digikam::Album::PHYSICAL, Digikam::Album::SEARCH, Digikam::Album::TAG, Digikam::Album::title(), and Digikam::Album::type().
Referenced by Digikam::AlbumFilterModel::lessThan().
|
overrideprotectedinherited |
|
signalinherited |
Indicates whether the newly applied filter results in a search result or not.
hasResult | true if the new filter matches any album, else false |
Referenced by Digikam::AlbumFilterModel::setSearchTextSettings().
|
inherited |
|
overridevirtual |
Returns if the currently applied filters will result in any filtering.
true
if the current selected filter could result in any filtering without checking if this really happens. Reimplemented from Digikam::AlbumFilterModel.
Reimplemented in Digikam::TagPropertiesFilterModel, and Digikam::SearchFilterModel.
References Digikam::AlbumFilterModel::isFiltering(), m_filterChecked, and m_filterPartiallyChecked.
|
overrideprotectedinherited |
Implementation to sort Tags that contain Unconfirmed Faces, according to the Unconfirmed Face Count.
References Digikam::ItemSortCollator::albumCompare(), Digikam::AlbumFilterModel::albumForIndex(), Digikam::ApplicationSettings::ByCategory, Digikam::ApplicationSettings::ByDate, Digikam::AlbumFilterModel::compareByOrder(), Digikam::AlbumFilterModel::dataForCurrentSortRole(), Digikam::ApplicationSettings::getAlbumSortRole(), Digikam::AlbumManager::getUnconfirmedFaceCount(), Digikam::Album::id(), Digikam::FaceTags::ignoredPersonTagId(), Digikam::AlbumManager::instance(), Digikam::ItemSortCollator::instance(), Digikam::ApplicationSettings::instance(), Digikam::AbstractAlbumModel::isFaceTagModel(), Digikam::ApplicationSettings::isStringTypeNatural(), Digikam::Album::isTrashAlbum(), Digikam::AlbumFilterModel::sourceAlbumModel(), Digikam::Album::TAG, Digikam::Album::type(), Digikam::FaceTags::unconfirmedPersonTagId(), and Digikam::FaceTags::unknownPersonTagId().
|
inherited |
References Digikam::AlbumFilterModel::m_chainedModel.
Referenced by Digikam::AlbumFilterModel::indexForAlbum(), and Digikam::AlbumFilterModel::rootAlbumIndex().
|
inherited |
References Digikam::AlbumFilterModel::m_chainedModel.
Referenced by Digikam::AbstractAlbumTreeView::dragMoveEvent(), and Digikam::AbstractAlbumTreeView::dropEvent().
|
overrideprotectedvirtual |
This method provides the basic match checking algorithm. Return true if this single album matches the current criteria. This method can be overridden to provide custom filtering.
album | the album to tell if it matches the filter criteria or not. |
Reimplemented from Digikam::AlbumFilterModel.
Reimplemented in Digikam::TagsManagerFilterModel, Digikam::TagPropertiesFilterModel, and Digikam::SearchFilterModel.
References Digikam::AbstractCheckableAlbumModel::checkState(), m_filterChecked, m_filterPartiallyChecked, Digikam::AlbumFilterModel::matches(), and sourceAlbumModel().
Referenced by Digikam::SearchFilterModel::matches(), and Digikam::TagPropertiesFilterModel::matches().
|
protectedinherited |
Returns if the filter matches this album (same logic as filterAcceptsRow). An album matches if the search text settings are found in a parent album's title, in the album's title or in a child album's title, or if it is a special album (root) that is never filtered out.
References Digikam::AlbumFilterModel::ChildMatch, Digikam::AlbumIterator::current(), Digikam::AlbumFilterModel::DirectMatch, Digikam::AlbumFilterModel::FullFiltering, Digikam::PAlbum::isAlbumRoot(), Digikam::TAlbum::isInternalTag(), Digikam::Album::isRoot(), Digikam::AlbumFilterModel::m_filterBehavior, Digikam::AlbumFilterModel::matches(), Digikam::AlbumFilterModel::NoMatch, Digikam::Album::parent(), Digikam::AlbumFilterModel::ParentMatch, Digikam::AlbumFilterModel::SimpleFiltering, and Digikam::AlbumFilterModel::SpecialMatch.
|
inherited |
Returns the MatchResult of an index of this model. Never returns NoMatch for a valid index, because in this case, the index would rather be filtered out.
References Digikam::AlbumFilterModel::albumForIndex().
Referenced by Digikam::AbstractAlbumTreeView::expandMatches(), and Digikam::AlbumFilterModel::filterAcceptsRow().
|
inherited |
References Digikam::AlbumFilterModel::mapFromSourceAlbumModel(), Digikam::AbstractAlbumModel::rootAlbumIndex(), and Digikam::AlbumFilterModel::sourceAlbumModel().
Referenced by Digikam::AbstractAlbumTreeView::setAlbumFilterModel(), Digikam::AbstractAlbumTreeView::setAlbumModel(), Digikam::TagTreeView::setAlbumModel(), Digikam::AlbumFilterModel::setSearchTextSettings(), Digikam::AbstractAlbumTreeView::slotCollapseAllNodes(), and Digikam::AbstractAlbumTreeView::slotRootAlbumAvailable().
|
inherited |
Returns the settings currently used for filtering.
References Digikam::AlbumFilterModel::m_settings.
|
signalinherited |
This signal indicates that a new SearchTextSettings arrived and is about to be applied to the model.
searched | true if filtering by text was enabled before applying the new settings |
willSearch | true if the new settings can result in any filtering by text, else false . |
Referenced by Digikam::AlbumFilterModel::setSearchTextSettings().
|
signalinherited |
Indicates that new search text settings were applied.
wasSearching | true if this is not a new search that |
searched | true if the new settings result in any filtering |
Referenced by Digikam::AlbumFilterModel::setSearchTextSettings().
|
inherited |
Sets the filter behavior. Default is FullFiltering.
References Digikam::AlbumFilterModel::m_filterBehavior.
void Digikam::CheckableAlbumFilterModel::setFilterChecked | ( | bool | filter | ) |
References m_filterChecked, and Digikam::AlbumFilterModel::signalFilterChanged().
void Digikam::CheckableAlbumFilterModel::setFilterPartiallyChecked | ( | bool | filter | ) |
References m_filterPartiallyChecked, and Digikam::AlbumFilterModel::signalFilterChanged().
|
slotinherited |
Accepts new settings used for filtering and applies them to the model.
settings | new settings to apply. An empty text will be interpreted as no filtering |
References Digikam::AlbumFilterModel::hasSearchResult(), Digikam::AlbumFilterModel::m_settings, Digikam::Album::PHYSICAL, Digikam::AlbumFilterModel::rootAlbumIndex(), Digikam::AlbumFilterModel::searchTextSettingsAboutToChange(), Digikam::AlbumFilterModel::searchTextSettingsChanged(), Digikam::AlbumFilterModel::signalFilterChanged(), Digikam::AlbumFilterModel::sourceAlbumModel(), and Digikam::SearchTextSettings::text.
Referenced by Digikam::AbstractAlbumTreeView::setSearchTextSettings().
|
inherited |
Sets the source model. Note: If a chained filter model is set, it will not be reset, but the source album model will be made source of the chained filter model.
References Digikam::AlbumFilterModel::m_chainedModel, and Digikam::AlbumFilterModel::setSourceModel().
Referenced by Digikam::AbstractAlbumTreeView::setAlbumFilterModel(), Digikam::AbstractAlbumTreeView::setAlbumModel(), Digikam::SearchFilterModel::setSourceAlbumModel(), setSourceAlbumModel(), and Digikam::AlbumFilterModel::setSourceFilterModel().
void Digikam::CheckableAlbumFilterModel::setSourceAlbumModel | ( | AbstractCheckableAlbumModel *const | source | ) |
References Digikam::AlbumFilterModel::setSourceAlbumModel().
Referenced by Digikam::TagPropertiesFilterModel::setSourceAlbumModel().
|
inherited |
Sets a chained filter model. Note: If a direct source album model is set as current source, it will be set as sourceAlbumModel of the new source filter model.
References Digikam::AlbumFilterModel::m_chainedModel, Digikam::AlbumFilterModel::setSourceAlbumModel(), Digikam::AlbumFilterModel::setSourceModel(), and Digikam::AlbumFilterModel::sourceAlbumModel().
Referenced by setSourceFilterModel().
void Digikam::CheckableAlbumFilterModel::setSourceFilterModel | ( | CheckableAlbumFilterModel *const | source | ) |
|
overrideprotectedinherited |
Use setSourceAlbumModel.
model | source model |
Referenced by Digikam::AlbumFilterModel::setSourceAlbumModel(), and Digikam::AlbumFilterModel::setSourceFilterModel().
|
signalinherited |
Indicates that a new filter was applied to the model.
Referenced by Digikam::TagPropertiesFilterModel::doNotListTagsWithProperty(), Digikam::TagPropertiesFilterModel::listOnlyTagsWithProperty(), Digikam::TagPropertiesFilterModel::removeDoNotListProperty(), Digikam::TagPropertiesFilterModel::removeListOnlyProperty(), setFilterChecked(), setFilterPartiallyChecked(), Digikam::SearchFilterModel::setListTemporarySearches(), Digikam::TagsManagerFilterModel::setQuickListTags(), Digikam::AlbumFilterModel::setSearchTextSettings(), and Digikam::SearchFilterModel::setTypeFilter().
|
protectedslotinherited |
References Digikam::AlbumFilterModel::slotAlbumsHaveBeenUpdated(), and Digikam::Album::type().
Referenced by Digikam::AlbumFilterModel::AlbumFilterModel().
|
protectedslotinherited |
References Digikam::AlbumFilterModel::sourceAlbumModel().
Referenced by Digikam::AlbumFilterModel::AlbumFilterModel(), and Digikam::AlbumFilterModel::slotAlbumRenamed().
AbstractCheckableAlbumModel * Digikam::CheckableAlbumFilterModel::sourceAlbumModel | ( | ) | const |
References Digikam::AlbumFilterModel::sourceAlbumModel().
Referenced by matches().
|
inherited |
References Digikam::AlbumFilterModel::m_chainedModel.
|
inherited |
Force invalidateFilter() externally.
References Digikam::AlbumFilterModel::isFiltering().
|
protectedinherited |
Referenced by Digikam::AlbumFilterModel::mapFromSourceAlbumModel(), Digikam::AlbumFilterModel::mapToSourceAlbumModel(), Digikam::AlbumFilterModel::matches(), Digikam::AlbumFilterModel::setSourceAlbumModel(), Digikam::AlbumFilterModel::setSourceFilterModel(), Digikam::AlbumFilterModel::sourceAlbumModel(), and Digikam::AlbumFilterModel::sourceFilterModel().
|
protectedinherited |
|
protected |
Referenced by isFiltering(), matches(), and setFilterChecked().
|
protected |
Referenced by isFiltering(), matches(), and setFilterPartiallyChecked().
|
protectedinherited |
|
protectedinherited |