24 #ifndef DIGIKAM_ITEM_SORT_SETTINGS_H
25 #define DIGIKAM_ITEM_SORT_SETTINGS_H
43 namespace DatabaseFields
54 AscendingOrder = Qt::AscendingOrder,
55 DescendingOrder = Qt::DescendingOrder,
83 SortByManualOrderAndDate
122 bool lessThan(
const QVariant& left,
const QVariant& right)
const;
124 void setSortRole(SortRole role);
125 void setSortOrder(SortOrder order);
126 void setStringTypeNatural(
bool natural);
132 void setCategorizationMode(CategorizationMode mode);
133 void setCategorizationSortOrder(SortOrder order);
138 return (categorizationMode >= CategoryByAlbum);
145 int compare(
const ItemInfo& left,
const ItemInfo& right, SortRole sortRole)
const;
147 static Qt::SortOrder defaultSortOrderForCategorizationMode(CategorizationMode mode);
148 static Qt::SortOrder defaultSortOrderForSortRole(SortRole role);
166 template <
typename T>
169 if (sortOrder == Qt::AscendingOrder)
180 template <
typename T>
202 if (sortOrder == Qt::AscendingOrder)
204 return compareResult;
207 return (- compareResult);
210 template <
typename T>
213 return compareByOrder(compareValue(a, b), sortOrder);
221 Qt::SortOrder sortOrder,
222 Qt::CaseSensitivity caseSensitive = Qt::CaseSensitive,
227 return compareByOrder(sorter->
itemCompare(a, b, caseSensitive, natural), sortOrder);
Definition: coredbfields.h:389
Definition: iteminfo.h:78
Definition: itemsortcollator.h:40
static ItemSortCollator * instance()
Definition: itemsortcollator.cpp:72
int itemCompare(const QString &a, const QString &b, Qt::CaseSensitivity caseSensitive, bool natural) const
Definition: itemsortcollator.cpp:77
Definition: itemsortsettings.h:49
Qt::CaseSensitivity categorizationCaseSensitivity
Definition: itemsortsettings.h:237
bool strTypeNatural
Definition: itemsortsettings.h:241
Qt::SortOrder currentSortOrder
Definition: itemsortsettings.h:243
static int naturalCompare(const QString &a, const QString &b, Qt::SortOrder sortOrder, Qt::CaseSensitivity caseSensitive=Qt::CaseSensitive, bool natural=true)
Definition: itemsortsettings.h:219
SortRole
Definition: itemsortsettings.h:70
@ SortByModificationDate
Definition: itemsortsettings.h:75
@ SortBySimilarity
Definition: itemsortsettings.h:81
@ SortByAspectRatio
width / height * 100000
Definition: itemsortsettings.h:79
@ SortByFileName
Definition: itemsortsettings.h:72
@ SortByImageSize
pixel number
Definition: itemsortsettings.h:78
@ SortByFaces
count of unconfirmed faces
Definition: itemsortsettings.h:80
@ SortByCreationDate
Definition: itemsortsettings.h:74
@ SortByFilePath
Definition: itemsortsettings.h:73
@ SortByManualOrderAndName
Definition: itemsortsettings.h:82
@ SortByFileSize
Definition: itemsortsettings.h:76
@ SortByRating
Definition: itemsortsettings.h:77
Qt::CaseSensitivity sortCaseSensitivity
Definition: itemsortsettings.h:244
static bool lessThanByOrder(const T &a, const T &b, Qt::SortOrder sortOrder)
— Utilities —
Definition: itemsortsettings.h:167
SortOrder sortOrder
Definition: itemsortsettings.h:240
bool isCategorized() const
Definition: itemsortsettings.h:136
static int compareValue(const T &a, const T &b)
Definition: itemsortsettings.h:181
Qt::SortOrder currentCategorizationSortOrder
Only Ascending or Descending, never DefaultOrder.
Definition: itemsortsettings.h:236
CategorizationMode
Definition: itemsortsettings.h:60
@ CategoryByMonth
Definition: itemsortsettings.h:65
@ OneCategory
all items in one global category
Definition: itemsortsettings.h:62
@ NoCategories
categorization switched off
Definition: itemsortsettings.h:61
@ CategoryByFormat
Definition: itemsortsettings.h:64
@ CategoryByAlbum
Definition: itemsortsettings.h:63
SortOrder categorizationSortOrder
Definition: itemsortsettings.h:233
static int compareByOrder(const T &a, const T &b, Qt::SortOrder sortOrder)
Definition: itemsortsettings.h:211
static int compareByOrder(int compareResult, Qt::SortOrder sortOrder)
Definition: itemsortsettings.h:200
CategorizationMode categorizationMode
Definition: itemsortsettings.h:232
SortOrder
Definition: itemsortsettings.h:53
SortRole sortRole
Definition: itemsortsettings.h:239
Definition: datefolderview.cpp:43
bool operator==(const SearchTextSettings &a, const SearchTextSettings &b)
Definition: searchtextbar.cpp:49