From b1cf498924e461556c8f2fe961172685d92bb03f Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 15 Feb 2020 13:24:56 -0500 Subject: split directoryentry made classes noncopyable, fixed a few unintended copies --- src/filetreemodel.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/filetreemodel.cpp') diff --git a/src/filetreemodel.cpp b/src/filetreemodel.cpp index 2130bf89..1a5433c5 100644 --- a/src/filetreemodel.cpp +++ b/src/filetreemodel.cpp @@ -1,5 +1,9 @@ #include "filetreemodel.h" #include "organizercore.h" +#include "filesorigin.h" +#include "util.h" +#include "shared/directoryentry.h" +#include "shared/fileentry.h" #include using namespace MOBase; @@ -637,7 +641,7 @@ bool FileTreeModel::updateFiles( // removeDisappearingFiles() will add files that are in the tree and still on // the filesystem to this set; addNewFiless() will use this to figure out if // a file is new or not - std::unordered_set seen; + std::unordered_set seen; int firstFileRow = 0; @@ -647,7 +651,7 @@ bool FileTreeModel::updateFiles( void FileTreeModel::removeDisappearingFiles( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, - int& firstFileRow, std::unordered_set& seen) + int& firstFileRow, std::unordered_set& seen) { auto& children = parentItem.children(); auto itor = children.begin(); @@ -708,7 +712,7 @@ void FileTreeModel::removeDisappearingFiles( bool FileTreeModel::addNewFiles( FileTreeItem& parentItem, const MOShared::DirectoryEntry& parentEntry, const std::wstring& parentPath, const int firstFileRow, - const std::unordered_set& seen) + const std::unordered_set& seen) { // keeps track of the contiguous files that need to be added to // avoid calling beginAddRows(), etc. for each item @@ -958,7 +962,7 @@ std::wstring FileTreeModel::makeModName( { static const std::wstring Unmanaged = UnmanagedModName().toStdWString(); - const auto origin = m_core.directoryStructure()->getOriginByID(originID); + const auto& origin = m_core.directoryStructure()->getOriginByID(originID); if (origin.getID() == 0) { return Unmanaged; -- cgit v1.3.1