diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-15 13:24:56 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-18 17:25:04 -0500 |
| commit | b1cf498924e461556c8f2fe961172685d92bb03f (patch) | |
| tree | f51694c37c17c87a8965eb9e8fab459d6f63d5ed /src/filetreemodel.cpp | |
| parent | 88ef0530001d43be8f18fac43a280169b45db852 (diff) | |
split directoryentry
made classes noncopyable, fixed a few unintended copies
Diffstat (limited to 'src/filetreemodel.cpp')
| -rw-r--r-- | src/filetreemodel.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
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 <log.h> 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<FileEntry::Index> seen; + std::unordered_set<FileIndex> 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<FileEntry::Index>& seen) + int& firstFileRow, std::unordered_set<FileIndex>& 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<FileEntry::Index>& seen) + const std::unordered_set<FileIndex>& 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; |
