summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qoperatingsystemversion.cpp
diff options
context:
space:
mode:
authorYuhang Zhao <2546789017@qq.com>2022-01-11 14:23:00 +0800
committerYuhang Zhao <2546789017@qq.com>2022-01-12 21:00:45 +0800
commit831b3506fcdd256e37f30e57334b09c890f0c481 (patch)
tree82d4cbc707b6d8cf0e4af89deb109a8258764009 /src/corelib/global/qoperatingsystemversion.cpp
parent4a4240f1bdf184a52a22b94f37090b07434770e7 (diff)
QOperatingSystemVersion: Make implementation consistent on all platforms
Only Windows is using lambda function, change to static member function to be consistent with other platforms. QOperatingSystemVersionBase::current()'s implementation is exactly the same on all platforms, so move it to the common source file instead of implementing it three times on each platform. Change-Id: I4099235b3b041a9a374e21d537649047ee03e62b Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global/qoperatingsystemversion.cpp')
-rw-r--r--src/corelib/global/qoperatingsystemversion.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/corelib/global/qoperatingsystemversion.cpp b/src/corelib/global/qoperatingsystemversion.cpp
index 8c4a393742..2255b08f68 100644
--- a/src/corelib/global/qoperatingsystemversion.cpp
+++ b/src/corelib/global/qoperatingsystemversion.cpp
@@ -155,6 +155,12 @@ QOperatingSystemVersion QOperatingSystemVersion::current()
return QOperatingSystemVersionBase::current();
}
+QOperatingSystemVersionBase QOperatingSystemVersionBase::current()
+{
+ static const QOperatingSystemVersionBase v = current_impl();
+ return v;
+}
+
#if !defined(Q_OS_DARWIN) && !defined(Q_OS_WIN)
QOperatingSystemVersionBase QOperatingSystemVersionBase::current_impl()
{
@@ -228,12 +234,6 @@ QOperatingSystemVersionBase QOperatingSystemVersionBase::current_impl()
#endif
return version;
}
-
-QOperatingSystemVersionBase QOperatingSystemVersionBase::current()
-{
- static const QOperatingSystemVersionBase v = current_impl();
- return v;
-}
#endif
static inline int compareVersionComponents(int lhs, int rhs)