Index: src/libchcore/TTaskManagerStatsSnapshot.cpp =================================================================== diff -u -r8a2ff3b2b71b45fb525e030167e62f316cb32869 -r294b7d63dfadb4e39fcbb52087983616981d00bd --- src/libchcore/TTaskManagerStatsSnapshot.cpp (.../TTaskManagerStatsSnapshot.cpp) (revision 8a2ff3b2b71b45fb525e030167e62f316cb32869) +++ src/libchcore/TTaskManagerStatsSnapshot.cpp (.../TTaskManagerStatsSnapshot.cpp) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) @@ -119,11 +119,13 @@ m_dAvgSizeSpeed += spTaskStats->GetAvgSizeSpeed(); } + static_assert(AssumedFileEquivalentSize == TTaskStatsSnapshot::AssumedFileEquivalentSize, "File equivalent sizes differs"); + // we're treating each of the items as 512B object to process // to have some balance between items' count and items' size in // progress information - unsigned long long ullProcessed = 512ULL * m_ullProcessedCount + m_ullProcessedSize; - unsigned long long ullTotal = 512ULL * m_ullTotalCount + m_ullTotalSize; + unsigned long long ullProcessed = AssumedFileEquivalentSize * m_ullProcessedCount + m_ullProcessedSize; + unsigned long long ullTotal = AssumedFileEquivalentSize * m_ullTotalCount + m_ullTotalSize; if (ullTotal != 0) m_dCombinedProgress = Math::Div64(ullProcessed, ullTotal); Index: src/libchcore/TTaskManagerStatsSnapshot.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r294b7d63dfadb4e39fcbb52087983616981d00bd --- src/libchcore/TTaskManagerStatsSnapshot.h (.../TTaskManagerStatsSnapshot.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TTaskManagerStatsSnapshot.h (.../TTaskManagerStatsSnapshot.h) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) @@ -31,6 +31,9 @@ class LIBCHCORE_API TTaskManagerStatsSnapshot { public: + static const unsigned long long AssumedFileEquivalentSize = 4096; + + public: TTaskManagerStatsSnapshot(); TTaskManagerStatsSnapshot(const TTaskManagerStatsSnapshot& rSrc) = delete; Index: src/libchcore/TTaskStatsSnapshot.cpp =================================================================== diff -u -r011ceadef0413975974fa61983d903bf1a900ab6 -r294b7d63dfadb4e39fcbb52087983616981d00bd --- src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 011ceadef0413975974fa61983d903bf1a900ab6) +++ src/libchcore/TTaskStatsSnapshot.cpp (.../TTaskStatsSnapshot.cpp) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) @@ -109,9 +109,8 @@ // we're treating each of the items as 4096 bytes object to process // to have some balance between items' count and items' size in // progress information - const unsigned long long ullSectorSize = 4096; - unsigned long long ullProcessed = ullSectorSize * m_ullProcessedCount + m_ullProcessedSize; - unsigned long long ullTotal = ullSectorSize * m_ullTotalCount + m_ullTotalSize; + unsigned long long ullProcessed = AssumedFileEquivalentSize * m_ullProcessedCount + m_ullProcessedSize; + unsigned long long ullTotal = AssumedFileEquivalentSize * m_ullTotalCount + m_ullTotalSize; if (ullTotal != 0) m_dCombinedProgress = Math::Div64(ullProcessed, ullTotal); Index: src/libchcore/TTaskStatsSnapshot.h =================================================================== diff -u -r4fe995b304ea342b50293f92d3c1992b43b820f7 -r294b7d63dfadb4e39fcbb52087983616981d00bd --- src/libchcore/TTaskStatsSnapshot.h (.../TTaskStatsSnapshot.h) (revision 4fe995b304ea342b50293f92d3c1992b43b820f7) +++ src/libchcore/TTaskStatsSnapshot.h (.../TTaskStatsSnapshot.h) (revision 294b7d63dfadb4e39fcbb52087983616981d00bd) @@ -36,6 +36,9 @@ class LIBCHCORE_API TTaskStatsSnapshot { public: + static const unsigned long long AssumedFileEquivalentSize = 4096; + + public: TTaskStatsSnapshot(); void Clear();