From 813ab32a2d16106f2799fba4e85c768a5b1c4850 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Sat, 29 Jun 2019 18:58:15 -0400 Subject: added a warning when running in compatibility mode --- src/shared/util.cpp | 14 +++++++++++++- src/shared/util.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'src/shared') diff --git a/src/shared/util.cpp b/src/shared/util.cpp index 9337ebf6..33094eff 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -653,6 +653,18 @@ WindowsVersion::WindowsVersion() : getElevated(); } +bool WindowsVersion::compatibilityMode() const +{ + if (m_realMajor == 0 && m_realMinor == 0 && m_realBuild == 0) { + return false; + } + + return + m_realMajor != m_major || + m_realMinor != m_minor || + m_realBuild != m_build; +} + QString WindowsVersion::toString() const { QStringList sl; @@ -665,7 +677,7 @@ QString WindowsVersion::toString() const sl.push_back("version: " + version); - if (m_realMajor != m_major || m_realMinor != m_minor || m_realBuild != m_build) { + if (compatibilityMode()) { sl.push_back("real version: " + realVersion); } diff --git a/src/shared/util.h b/src/shared/util.h index deaf6fcc..232a97bb 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -97,6 +97,7 @@ class WindowsVersion public: WindowsVersion(); + bool compatibilityMode() const; QString toString() const; private: -- cgit v1.3.1