]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.h
Add case sensitive sorting mode
[dolphin.git] / src / kitemviews / kfileitemmodel.h
index df7a5e3f024619fbbfdc090d7540262199e4c404..8a0df72b921cf933278ef7b7cd0a923080b08777 100644 (file)
@@ -20,8 +20,8 @@
 #ifndef KFILEITEMMODEL_H
 #define KFILEITEMMODEL_H
 
-#include "libdolphin_export.h"
-#include <KFileItemList>
+#include "dolphin_export.h"
+#include <KFileItem>
 #include <QUrl>
 #include <kitemviews/kitemmodelbase.h>
 #include <kitemviews/private/kfileitemmodelfilter.h>
@@ -43,7 +43,7 @@ class QTimer;
  * Recursive expansion of sub-directories is supported by
  * KFileItemModel::setExpanded().
  */
-class LIBDOLPHINPRIVATE_EXPORT KFileItemModel : public KItemModelBase
+class DOLPHIN_EXPORT KFileItemModel : public KItemModelBase
 {
     Q_OBJECT
 
@@ -273,7 +273,7 @@ private slots:
     void slotItemsDeleted(const KFileItemList& items);
     void slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >& items);
     void slotClear();
-    void slotNaturalSortingChanged();
+    void slotSortingChoiceChanged();
 
     void dispatchPendingItemsToInsert();
 
@@ -285,7 +285,7 @@ private:
         // User visible roles available with Baloo:
         CommentRole, TagsRole, RatingRole, ImageSizeRole, OrientationRole,
         WordCountRole, LineCountRole, ArtistRole, AlbumRole, DurationRole, TrackRole,
-        CopiedFromRole,
+        OriginUrlRole,
         // Non-visible roles:
         IsDirRole, IsLinkRole, IsExpandedRole, IsExpandableRole, ExpandedParentsCountRole,
         // Mandatory last entry:
@@ -362,7 +362,7 @@ private:
      * @return True if the item-data \a a should be ordered before the item-data
      *         \b. The item-data may have different parent-items.
      */
-    bool lessThan(const ItemData* a, const ItemData* b) const;
+    bool lessThan(const ItemData* a, const ItemData* b, const QCollator& collator) const;
 
     /**
      * Sorts the items between \a begin and \a end using the comparison
@@ -375,9 +375,9 @@ private:
      * the passed item-data using m_sortRole as criteria. Both items must
      * have the same parent item, otherwise the comparison will be wrong.
      */
-    int sortRoleCompare(const ItemData* a, const ItemData* b) const;
+    int sortRoleCompare(const ItemData* a, const ItemData* b, const QCollator& collator) const;
 
-    int stringCompare(const QString& a, const QString& b) const;
+    int stringCompare(const QString& a, const QString& b, const QCollator& collator) const;
 
     bool useMaximumUpdateInterval() const;
 
@@ -415,6 +415,11 @@ private:
      */
     void removeFilteredChildren(const KItemRangeList& parents);
 
+    /**
+     * Loads the selected choice of sorting method from Dolphin General Settings
+     */
+    void loadSortingSettings();
+
     /**
      * Maps the QByteArray-roles to RoleTypes and provides translation- and
      * group-contexts.