X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/6e88d7cef072e1b504f5d428a2ce7d8aff736a8d..76a46fd9094b17eb99e8a42cca8562fdc0b3814c:/src/kitemviews/kfileitemmodel.h?ds=sidebyside diff --git a/src/kitemviews/kfileitemmodel.h b/src/kitemviews/kfileitemmodel.h index d15cfebc1..132a76e46 100644 --- a/src/kitemviews/kfileitemmodel.h +++ b/src/kitemviews/kfileitemmodel.h @@ -288,7 +288,7 @@ private: // User visible roles available with Baloo: CommentRole, TagsRole, RatingRole, WidthRole, HeightRole, ImageDateTimeRole, OrientationRole, WordCountRole, TitleRole, LineCountRole, ArtistRole, GenreRole, AlbumRole, DurationRole, TrackRole, ReleaseYearRole, - BitrateRole, OriginUrlRole, + BitrateRole, OriginUrlRole, AspectRatioRole, FrameRateRole, // Non-visible roles: IsDirRole, IsLinkRole, IsHiddenRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole, // Mandatory last entry: @@ -355,6 +355,11 @@ private: QHash retrieveData(const KFileItem& item, const ItemData* parent) const; + /** + * @return True if role values benefit from natural or case insensitive sorting. + */ + static bool isRoleValueNatural(const RoleType roleType); + /** * @return True if \a a has a KFileItem whose text is 'less than' the one * of \a b according to QString::operator<(const QString&). @@ -382,8 +387,6 @@ private: int stringCompare(const QString& a, const QString& b, const QCollator& collator) const; - bool useMaximumUpdateInterval() const; - QList > nameRoleGroups() const; QList > sizeRoleGroups() const; QList > timeRoleGroups(const std::function &fileTimeCb) const; @@ -506,12 +509,27 @@ private: friend class DolphinPart; // Accesses m_dirLister }; +inline bool KFileItemModel::isRoleValueNatural(RoleType roleType) +{ + return (roleType == TypeRole || + roleType == TagsRole || + roleType == CommentRole || + roleType == TitleRole || + roleType == ArtistRole || + roleType == GenreRole || + roleType == AlbumRole || + roleType == PathRole || + roleType == DestinationRole || + roleType == OriginUrlRole || + roleType == OwnerRole || + roleType == GroupRole); +} + inline bool KFileItemModel::nameLessThan(const ItemData* a, const ItemData* b) { return a->item.text() < b->item.text(); } - inline bool KFileItemModel::isChildItem(int index) const { if (m_itemData.at(index)->parent) {