From 9c2fc694051b8e500a3343322dd45cf8be1c1b7d Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Fri, 7 Feb 2020 11:26:11 -0500 Subject: sort on demand --- src/filetreemodel.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/filetreemodel.cpp') 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); -- cgit v1.3.1