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 | setSourceAlbumModel (AbstractAlbumModel *const source) |
void | setSourceModel (QAbstractItemModel *const model) override |
void | setTypeFilter (int type) |
Protected Attributes | |
QPointer< AlbumFilterModel > | m_chainedModel |
FilterBehavior | m_filterBehavior |
bool | m_filterChecked |
bool | m_filterPartiallyChecked |
bool | m_listTemporary |
QObject * | m_parent |
int | m_searchType |
SearchTextSettings | m_settings |
Filter model for searches that can filter by search type
|
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::CheckableAlbumFilterModel.
References m_listTemporary, and m_searchType.
|
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().
void Digikam::SearchFilterModel::listAllSearches | ( | ) |
References setTypeFilter().
void Digikam::SearchFilterModel::listDuplicatesSearches | ( | ) |
References Digikam::DatabaseSearch::DuplicatesSearch, and setTypeFilter().
void Digikam::SearchFilterModel::listHaarSearches | ( | ) |
References Digikam::DatabaseSearch::HaarSearch, and setTypeFilter().
Referenced by Digikam::FuzzySearchView::FuzzySearchView().
void Digikam::SearchFilterModel::listMapSearches | ( | ) |
References Digikam::DatabaseSearch::MapSearch, and setTypeFilter().
void Digikam::SearchFilterModel::listNormalSearches | ( | ) |
References setTypeFilter().
void Digikam::SearchFilterModel::listTimelineSearches | ( | ) |
References setTypeFilter(), and Digikam::DatabaseSearch::TimeLineSearch.
|
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::CheckableAlbumFilterModel.
References Digikam::SAlbum::isNormalSearch(), Digikam::SAlbum::isTemporarySearch(), m_listTemporary, m_searchType, Digikam::CheckableAlbumFilterModel::matches(), and Digikam::SAlbum::searchType().
|
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.
|
inherited |
|
inherited |
void Digikam::SearchFilterModel::setFilterSearchType | ( | DatabaseSearch::Type | type | ) |
Set the DatabaseSearch::Type.
References setTypeFilter().
void Digikam::SearchFilterModel::setListTemporarySearches | ( | bool | list | ) |
Sets if temporary search albums shall be listed
References m_listTemporary, and Digikam::AlbumFilterModel::signalFilterChanged().
Referenced by Digikam::FuzzySearchView::FuzzySearchView().
|
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().
|
protected |
References Digikam::AlbumFilterModel::setSourceAlbumModel().
Referenced by setSourceSearchModel().
|
inherited |
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 Digikam::CheckableAlbumFilterModel::setSourceFilterModel().
|
inherited |
|
overrideprotectedinherited |
Use setSourceAlbumModel.
model | source model |
Referenced by Digikam::AlbumFilterModel::setSourceAlbumModel(), and Digikam::AlbumFilterModel::setSourceFilterModel().
void Digikam::SearchFilterModel::setSourceSearchModel | ( | SearchModel *const | source | ) |
References setSourceAlbumModel().
Referenced by Digikam::SearchTreeView::setAlbumModel().
|
protected |
References m_searchType, and Digikam::AlbumFilterModel::signalFilterChanged().
Referenced by listAllSearches(), listDuplicatesSearches(), listHaarSearches(), listMapSearches(), listNormalSearches(), listTimelineSearches(), and setFilterSearchType().
|
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(), Digikam::CheckableAlbumFilterModel::setFilterChecked(), Digikam::CheckableAlbumFilterModel::setFilterPartiallyChecked(), setListTemporarySearches(), Digikam::TagsManagerFilterModel::setQuickListTags(), Digikam::AlbumFilterModel::setSearchTextSettings(), and 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().
|
inherited |
References Digikam::AlbumFilterModel::sourceAlbumModel().
Referenced by Digikam::CheckableAlbumFilterModel::matches().
|
inherited |
References Digikam::AlbumFilterModel::m_chainedModel.
SearchModel * Digikam::SearchFilterModel::sourceSearchModel | ( | ) | const |
|
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 |
|
protectedinherited |
|
protectedinherited |
|
protected |
Referenced by isFiltering(), matches(), and setListTemporarySearches().
|
protectedinherited |
|
protected |
Referenced by isFiltering(), matches(), and setTypeFilter().
|
protectedinherited |