diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-14 03:19:21 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-02-18 17:25:03 -0500 |
| commit | fb3fbd34211a28b27214abe070c46951057258ca (patch) | |
| tree | 62c1505014682af6f8b88c17f5c985716b0d40fc /src/directoryrefresher.cpp | |
| parent | 567fe019ac21ee78a07beae1a387ab5688e7f97b (diff) | |
removed lastAccessed from FileEntry, not used
FileRegister keeps a vector instead of a map
Diffstat (limited to 'src/directoryrefresher.cpp')
| -rw-r--r-- | src/directoryrefresher.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index cb5bfc5b..f3285cfc 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -39,7 +39,7 @@ using namespace MOShared; DirectoryRefresher::DirectoryRefresher(std::size_t threadCount)
- : m_DirectoryStructure(nullptr), m_threadCount(threadCount)
+ : m_DirectoryStructure(nullptr), m_threadCount(threadCount), m_lastFileCount(0)
{
}
@@ -283,7 +283,9 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( const auto& e = entries[i];
const int prio = static_cast<int>(i + 1);
- stats[i].mod = entries[i].modName.toStdString();
+ if constexpr (DirectoryStats::EnableInstrumentation) {
+ stats[i].mod = entries[i].modName.toStdString();
+ }
try
{
@@ -312,7 +314,9 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( g_threads.waitForAll();
- dumpStats(stats);
+ if constexpr (DirectoryStats::EnableInstrumentation) {
+ dumpStats(stats);
+ }
}
void DirectoryRefresher::refresh()
@@ -325,6 +329,7 @@ void DirectoryRefresher::refresh() delete m_DirectoryStructure;
m_DirectoryStructure = new DirectoryEntry(L"data", nullptr, 0);
+ m_DirectoryStructure->getFileRegister()->reserve(m_lastFileCount);
IPluginGame *game = qApp->property("managed_game").value<IPluginGame*>();
@@ -347,6 +352,8 @@ void DirectoryRefresher::refresh() cleanStructure(m_DirectoryStructure);
}
+ m_lastFileCount = m_DirectoryStructure->getFileRegister()->highestCount();
+
emit progress(100);
emit refreshed();
}
|
