]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.h
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / kitemviews / kfileitemmodel.h
index f87d2d5437af262e7823f8acb38e51fbd1eb1fb8..10be27128832d3bb8e02ff87bdf55a23ec2d0de4 100644 (file)
@@ -109,6 +109,8 @@ public:
 
     bool supportsDropping(int index) const override;
 
+    bool canEnterOnHover(int index) const override;
+
     QString roleDescription(const QByteArray &role) const override;
 
     QList<QPair<int, QVariant>> groups() const override;
@@ -205,8 +207,6 @@ public:
     /** set to true to hide application/x-trash files */
     void setShowTrashMime(bool show);
 
-    void scheduleResortAllItems();
-
 Q_SIGNALS:
     /**
      * Is emitted if the loading of a directory has been started. It is
@@ -258,7 +258,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
@@ -365,7 +365,11 @@ private:
         ItemData *parent;
     };
 
-    enum RemoveItemsBehavior { KeepItemData, DeleteItemData, DeleteItemDataIfUnfiltered };
+    enum RemoveItemsBehavior {
+        KeepItemData,
+        DeleteItemData,
+        DeleteItemDataIfUnfiltered
+    };
 
     void insertItems(QList<ItemData *> &items);
     void removeItems(const KItemRangeList &itemRanges, RemoveItemsBehavior behavior);
@@ -464,6 +468,8 @@ private:
      */
     bool isChildItem(int index) const;
 
+    void scheduleResortAllItems();
+
     /**
      * Is invoked by KFileItemModelRolesUpdater and results in emitting the
      * sortProgress signal with a percent-value of the progress.
@@ -586,7 +592,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