From 637188a58bd99e6355ced6c296533c362fb8efd6 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 26 Nov 2019 06:21:16 -0500 Subject: don't log md5 for any system file --- src/envmodule.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/envmodule.cpp b/src/envmodule.cpp index 13831631..8d348b5e 100644 --- a/src/envmodule.cpp +++ b/src/envmodule.cpp @@ -295,10 +295,19 @@ QDateTime Module::getTimestamp(const VS_FIXEDFILEINFO& fi) const QString Module::getMD5() const { - if (m_path.contains("\\windows\\", Qt::CaseInsensitive)) { - // don't calculate md5 for system files, it's not really relevant and - // it takes a while - return {}; + static const std::set ignore = { + "\\windows\\", + "\\program files\\", + "\\program files (x86)\\", + "\\programdata\\" + }; + + // don't calculate md5 for system files, it's not really relevant and + // it takes a while + for (auto&& i : ignore) { + if (m_path.contains(i, Qt::CaseInsensitive)) { + return {}; + } } // opening the file -- cgit v1.3.1