]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.h
Merge remote-tracking branch 'fork/work/zakharafoniam/useful-groups'
[dolphin.git] / src / kitemviews / kfileitemmodel.h
index edc77457babc9dddefcfb33731fb6523322b4f35..13554d8c7fa1999dc62e8fd355c71967096ca9e5 100644 (file)
@@ -211,6 +211,13 @@ public:
      */
     static QList<RoleInfo> rolesInformation();
 
+    /**
+     * @return Provides static information for all available grouping
+     *         behaviors supported by KFileItemModel but not directly
+     *         mapped to roles of KFileItemModel.
+     */
+    static QList<RoleInfo> extraGroupingInformation();
+
     /** set to true to hide application/x-trash files */
     void setShowTrashMime(bool show);
 
@@ -265,7 +272,7 @@ Q_SIGNALS:
      * Is emitted if an error message (e.g. "Unknown location")
      * should be shown.
      */
-    void errorMessage(const QString &message);
+    void errorMessage(const QString &message, const int kioErrorCode);
 
     /**
      * Is emitted if a redirection from the current URL \a oldUrl
@@ -373,7 +380,7 @@ private:
         QHash<QByteArray, QVariant> values;
         ItemData *parent;
     };
-
+    
     struct ItemGroupInfo {
         int comparable;
         QString text;
@@ -580,7 +587,6 @@ private:
     bool m_naturalSorting;
     bool m_sortDirsFirst;
     bool m_sortHiddenLast;
-    int m_dirSizeMode;
 
     RoleType m_sortRole;
     RoleType m_groupRole;
@@ -633,7 +639,9 @@ inline bool KFileItemModel::isRoleValueNatural(RoleType roleType)
 
 inline bool KFileItemModel::nameLessThan(const ItemData *a, const ItemData *b)
 {
-    return a->item.text() < b->item.text();
+    // Split extension, taking into account it can be empty
+    constexpr QString::SectionFlags flags = QString::SectionSkipEmpty | QString::SectionIncludeLeadingSep;
+    return a->item.text().section('.', 0, 0, flags) < b->item.text().section('.', 0, 0, flags);
 }
 
 inline bool KFileItemModel::isChildItem(int index) const