digiKam
|
Public Types | |
enum | CategorizationMode { NoCategories , OneCategory , CategoryByAlbum , CategoryByFormat , CategoryByMonth , CategoryByFaces } |
enum | SortOrder { AscendingOrder = Qt::AscendingOrder , DescendingOrder = Qt::DescendingOrder , DefaultOrder } |
enum | SortRole { SortByFileName , SortByFilePath , SortByCreationDate , SortByModificationDate , SortByFileSize , SortByRating , SortByImageSize , SortByAspectRatio , SortByFaces , SortBySimilarity , SortByManualOrderAndName , SortByManualOrderAndDate } |
Public Member Functions | |
int | compare (const ItemInfo &left, const ItemInfo &right) const |
int | compare (const ItemInfo &left, const ItemInfo &right, SortRole sortRole) const |
— Image Sorting — More... | |
int | compareCategories (const ItemInfo &left, const ItemInfo &right, const FaceTagsIface &leftFace, const FaceTagsIface &rightFace) const |
bool | isCategorized () const |
ItemSortSettings () | |
bool | lessThan (const ItemInfo &left, const ItemInfo &right) const |
bool | lessThan (const QVariant &left, const QVariant &right) const |
bool | operator== (const ItemSortSettings &other) const |
void | setCategorizationMode (CategorizationMode mode) |
— Categories — More... | |
void | setCategorizationSortOrder (SortOrder order) |
void | setSortOrder (SortOrder order) |
void | setSortRole (SortRole role) |
void | setStringTypeNatural (bool natural) |
DatabaseFields::Set | watchFlags () const |
— Change notification — More... | |
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) |
static Qt::SortOrder | defaultSortOrderForCategorizationMode (CategorizationMode mode) |
static Qt::SortOrder | defaultSortOrderForSortRole (SortRole role) |
template<typename T > | |
static bool | lessThanByOrder (const T &a, const T &b, Qt::SortOrder sortOrder) |
— Utilities — More... | |
static int | naturalCompare (const QString &a, const QString &b, Qt::SortOrder sortOrder, Qt::CaseSensitivity caseSensitive=Qt::CaseSensitive, bool natural=true) |
Public Attributes | |
Qt::CaseSensitivity | categorizationCaseSensitivity |
CategorizationMode | categorizationMode |
SortOrder | categorizationSortOrder |
Qt::SortOrder | currentCategorizationSortOrder |
Only Ascending or Descending, never DefaultOrder. More... | |
Qt::SortOrder | currentSortOrder |
Qt::CaseSensitivity | sortCaseSensitivity |
SortOrder | sortOrder |
SortRole | sortRole |
bool | strTypeNatural |
|
explicit |
Compares the ItemInfos left and right. Return -1 if left is less than right, 1 if left is greater than right, and 0 if left equals right comparing the current sort role's value. Adheres to set sort role and sort order.
References sortRole.
Referenced by lessThan().
int Digikam::ItemSortSettings::compare | ( | const ItemInfo & | left, |
const ItemInfo & | right, | ||
SortRole | sortRole | ||
) | const |
— Image Sorting —
References compareByOrder(), Digikam::ItemInfo::currentReferenceImage(), Digikam::ItemInfo::currentSimilarity(), currentSortOrder, Digikam::ItemInfo::dateTime(), Digikam::ItemInfo::dimensions(), Digikam::ItemInfo::filePath(), Digikam::ItemInfo::fileSize(), Digikam::ItemInfo::id(), Digikam::ItemInfo::manualOrder(), Digikam::ItemInfo::modDateTime(), Digikam::ItemInfo::name(), naturalCompare(), Digikam::ItemInfo::rating(), SortByAspectRatio, SortByCreationDate, SortByFaces, SortByFileName, SortByFilePath, SortByFileSize, SortByImageSize, SortByManualOrderAndDate, SortByManualOrderAndName, SortByModificationDate, SortByRating, SortBySimilarity, sortCaseSensitivity, strTypeNatural, and Digikam::ItemInfo::unconfirmedFaceCount().
|
inlinestatic |
|
inlinestatic |
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 compare(), compareCategories(), Digikam::ItemAlbumFilterModel::compareInfosCategories(), and lessThan().
int Digikam::ItemSortSettings::compareCategories | ( | const ItemInfo & | left, |
const ItemInfo & | right, | ||
const FaceTagsIface & | leftFace, | ||
const FaceTagsIface & | rightFace | ||
) | const |
Compares the categories of left and right. Return -1 if left is less than right, 0 if both fall in the same category, and 1 if left is greater than right. Adheres to set categorization mode and current category sort order. Face passed in to allow Categorization by Faces. Pass in an empty Face if not needed.
References Digikam::ItemInfo::albumId(), categorizationCaseSensitivity, categorizationMode, CategoryByAlbum, CategoryByFaces, CategoryByFormat, CategoryByMonth, compareByOrder(), Digikam::FaceTagsIface::ConfirmedName, currentCategorizationSortOrder, Digikam::ItemInfo::dateTime(), Digikam::ItemInfo::faceCount(), Digikam::FaceTags::faceNameForTag(), Digikam::ItemInfo::format(), Digikam::ItemInfo::getSuggestedNames(), Digikam::FaceTagsIface::IgnoredName, Digikam::FaceTagsIface::isNull(), lessThanByOrder(), naturalCompare(), NoCategories, OneCategory, Digikam::FaceTagsIface::region(), strTypeNatural, Digikam::FaceTagsIface::tagId(), Digikam::TagRegion::toXml(), Digikam::FaceTagsIface::type(), Digikam::FaceTagsIface::UnconfirmedName, and Digikam::FaceTagsIface::UnknownName.
|
inlinestatic |
Returns the usual compare result of -1, 0, or 1 for lessThan, equals and greaterThan.
|
static |
References CategoryByAlbum, CategoryByFormat, CategoryByMonth, NoCategories, and OneCategory.
Referenced by setCategorizationMode(), and setCategorizationSortOrder().
|
static |
References SortByAspectRatio, SortByCreationDate, SortByFaces, SortByFileName, SortByFilePath, SortByFileSize, SortByImageSize, SortByManualOrderAndDate, SortByManualOrderAndName, SortByModificationDate, SortByRating, and SortBySimilarity.
Referenced by setSortOrder(), and setSortRole().
|
inline |
Returns true if left is less than right. Adheres to current sort role and sort order.
References compare(), SortByCreationDate, SortByFileName, SortByFilePath, SortByFileSize, SortByManualOrderAndDate, SortByManualOrderAndName, SortByModificationDate, SortBySimilarity, and sortRole.
bool Digikam::ItemSortSettings::lessThan | ( | const QVariant & | left, |
const QVariant & | right | ||
) | const |
Returns true if left QVariant is less than right. Adheres to current sort role and sort order. Use for extraValue, if necessary.
References compareByOrder(), currentSortOrder, naturalCompare(), sortCaseSensitivity, and strTypeNatural.
|
inlinestatic |
— Utilities —
Returns a < b if sortOrder is Ascending, or b < a if order is descending.
Referenced by compareCategories().
|
inlinestatic |
Compares the two string by natural comparison and adheres to given sort order
References Digikam::ItemSortCollator::instance(), and Digikam::ItemSortCollator::itemCompare().
Referenced by compare(), compareCategories(), Digikam::ItemAlbumFilterModel::compareInfosCategories(), and lessThan().
bool Digikam::ItemSortSettings::operator== | ( | const ItemSortSettings & | other | ) | const |
void Digikam::ItemSortSettings::setCategorizationMode | ( | CategorizationMode | mode | ) |
— Categories —
References categorizationMode, categorizationSortOrder, currentCategorizationSortOrder, DefaultOrder, and defaultSortOrderForCategorizationMode().
void Digikam::ItemSortSettings::setCategorizationSortOrder | ( | SortOrder | order | ) |
void Digikam::ItemSortSettings::setSortOrder | ( | SortOrder | order | ) |
References currentSortOrder, DefaultOrder, defaultSortOrderForSortRole(), sortOrder, and sortRole.
void Digikam::ItemSortSettings::setSortRole | ( | SortRole | role | ) |
References currentSortOrder, DefaultOrder, defaultSortOrderForSortRole(), sortOrder, and sortRole.
void Digikam::ItemSortSettings::setStringTypeNatural | ( | bool | natural | ) |
References strTypeNatural.
DatabaseFields::Set Digikam::ItemSortSettings::watchFlags | ( | ) | const |
— Change notification —
Returns database fields a change in which would affect the current sorting.
References Digikam::DatabaseFields::Album, categorizationMode, CategoryByAlbum, CategoryByFaces, CategoryByFormat, CategoryByMonth, Digikam::DatabaseFields::CreationDate, Digikam::DatabaseFields::FileSize, Digikam::DatabaseFields::Format, Digikam::DatabaseFields::Height, Digikam::DatabaseFields::ManualOrder, Digikam::DatabaseFields::ModificationDate, Digikam::DatabaseFields::Name, NoCategories, OneCategory, Digikam::DatabaseFields::Rating, SortByAspectRatio, SortByCreationDate, SortByFaces, SortByFileName, SortByFilePath, SortByFileSize, SortByImageSize, SortByManualOrderAndDate, SortByManualOrderAndName, SortByModificationDate, SortByRating, SortBySimilarity, sortRole, and Digikam::DatabaseFields::Width.
Qt::CaseSensitivity Digikam::ItemSortSettings::categorizationCaseSensitivity |
Referenced by compareCategories(), and operator==().
CategorizationMode Digikam::ItemSortSettings::categorizationMode |
Referenced by compareCategories(), operator==(), setCategorizationMode(), setCategorizationSortOrder(), and watchFlags().
SortOrder Digikam::ItemSortSettings::categorizationSortOrder |
Referenced by operator==(), setCategorizationMode(), and setCategorizationSortOrder().
Qt::SortOrder Digikam::ItemSortSettings::currentCategorizationSortOrder |
Only Ascending or Descending, never DefaultOrder.
Referenced by compareCategories(), setCategorizationMode(), and setCategorizationSortOrder().
Qt::SortOrder Digikam::ItemSortSettings::currentSortOrder |
Referenced by compare(), lessThan(), setSortOrder(), and setSortRole().
Qt::CaseSensitivity Digikam::ItemSortSettings::sortCaseSensitivity |
Referenced by compare(), lessThan(), and operator==().
SortOrder Digikam::ItemSortSettings::sortOrder |
Referenced by operator==(), setSortOrder(), and setSortRole().
SortRole Digikam::ItemSortSettings::sortRole |
Referenced by compare(), lessThan(), operator==(), setSortOrder(), setSortRole(), and watchFlags().
bool Digikam::ItemSortSettings::strTypeNatural |
Referenced by compare(), compareCategories(), lessThan(), and setStringTypeNatural().