summaryrefslogtreecommitdiff
path: root/src/filetreemodel.cpp
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.cpp
parent41e6189be431dbd41b9d41751b01708df06a9610 (diff)
sort on demand
Diffstat (limited to 'src/filetreemodel.cpp')
-rw-r--r--src/filetreemodel.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/filetreemodel.cpp b/src/filetreemodel.cpp
index 169d0a02..01a10afc 100644
--- a/src/filetreemodel.cpp
+++ b/src/filetreemodel.cpp
@@ -138,7 +138,7 @@ void* makeInternalPointer(FileTreeItem* item)
FileTreeModel::FileTreeModel(OrganizerCore& core, QObject* parent) :
QAbstractItemModel(parent), m_core(core), m_enabled(true),
- m_root(FileTreeItem::createDirectory(nullptr, L"", L"")),
+ m_root(FileTreeItem::createDirectory(this, nullptr, L"", L"")),
m_flags(NoFlags), m_fullyLoaded(false)
{
m_root->setExpanded(true);
@@ -193,6 +193,11 @@ void FileTreeModel::setEnabled(bool b)
m_enabled = b;
}
+const FileTreeModel::SortInfo& FileTreeModel::sortInfo() const
+{
+ return m_sort;
+}
+
bool FileTreeModel::showArchives() const
{
return (m_flags.testFlag(Archives) && m_core.getArchiveParsing());
@@ -756,7 +761,7 @@ FileTreeItem::Ptr FileTreeModel::createDirectoryItem(
const DirectoryEntry& d)
{
auto item = FileTreeItem::createDirectory(
- &parentItem, parentPath, d.getName());
+ this, &parentItem, parentPath, d.getName());
if (d.isEmpty()) {
// if this directory is empty, mark the item as loaded so the expand
@@ -772,7 +777,7 @@ FileTreeItem::Ptr FileTreeModel::createFileItem(
const FileEntry& file)
{
auto item = FileTreeItem::createFile(
- &parentItem, parentPath, file.getName());
+ this, &parentItem, parentPath, file.getName());
updateFileItem(*item, file);