summaryrefslogtreecommitdiff
path: root/src/filetreemodel.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-02-07 11:26:11 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-02-07 11:26:11 -0500
commit9c2fc694051b8e500a3343322dd45cf8be1c1b7d (patch)
tree243180a392d84bb4649d0b38909560a7b3ccb7bf /src/filetreemodel.h
parent41e6189be431dbd41b9d41751b01708df06a9610 (diff)
sort on demand
Diffstat (limited to 'src/filetreemodel.h')
-rw-r--r--src/filetreemodel.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/filetreemodel.h b/src/filetreemodel.h
index 1bc7f73b..deb6d092 100644
--- a/src/filetreemodel.h
+++ b/src/filetreemodel.h
@@ -34,6 +34,13 @@ public:
Q_DECLARE_FLAGS(Flags, Flag);
+ struct SortInfo
+ {
+ int column = 0;
+ Qt::SortOrder order = Qt::AscendingOrder;
+ };
+
+
FileTreeModel(OrganizerCore& core, QObject* parent=nullptr);
void setFlags(Flags f)
@@ -48,6 +55,8 @@ public:
bool enabled() const;
void setEnabled(bool b);
+ const SortInfo& sortInfo() const;
+
QModelIndex index(int row, int col, const QModelIndex& parent={}) const override;
QModelIndex parent(const QModelIndex& index) const override;
int rowCount(const QModelIndex& parent={}) const override;
@@ -63,12 +72,6 @@ public:
FileTreeItem* itemFromIndex(const QModelIndex& index) const;
private:
- struct Sort
- {
- int column = 0;
- Qt::SortOrder order = Qt::AscendingOrder;
- };
-
class Range;
using DirectoryIterator = std::vector<MOShared::DirectoryEntry*>::const_iterator;
@@ -80,7 +83,7 @@ private:
mutable IconFetcher m_iconFetcher;
mutable std::vector<QModelIndex> m_iconPending;
mutable QTimer m_iconPendingTimer;
- Sort m_sort;
+ SortInfo m_sort;
bool m_fullyLoaded;
bool showConflictsOnly() const