summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/global/qglobal.cpp')
-rw-r--r--src/corelib/global/qglobal.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e7bfbb2903..6de03d73b3 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -2643,12 +2643,14 @@ QString QSysInfo::kernelVersion()
to determine the distribution name and returns that. If determining the
distribution name failed, it returns "unknown".
- \b{Darwin, \macos, iOS, tvOS, and watchOS note}: this function returns
- "macos" for \macos systems, "ios" for iOS systems, "tvos" for tvOS systems,
- "watchos" for watchOS systems, and "darwin" in case the system could not
- be determined.
+ \b{\macos note}: this function returns "osx" for all \macos systems,
+ regardless of Apple naming convention. The returned string will be updated
+ for Qt 6. Note that this function erroneously returned "macos" for \macos
+ 10.12 in Qt versions 5.6.2, 5.7.1, and 5.8.0.
- \b{OS X note}: this function returns "osx" for versions of \macos prior to 10.12.
+ \b{Darwin, iOS, tvOS, and watchOS note}: this function returns "ios" for
+ iOS systems, "tvos" for tvOS systems, "watchos" for watchOS systems, and
+ "darwin" in case the system could not be determined.
\b{FreeBSD note}: this function returns "debian" for Debian/kFreeBSD and
"unknown" otherwise.
@@ -2681,10 +2683,12 @@ QString QSysInfo::productType()
#elif defined(Q_OS_WATCHOS)
return QStringLiteral("watchos");
#elif defined(Q_OS_MACOS)
- const auto version = QOperatingSystemVersion::current();
- if (version.majorVersion() == 10 && version.minorVersion() < 12)
- return QStringLiteral("osx");
+ // ### Qt6: remove fallback
+# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
return QStringLiteral("macos");
+# else
+ return QStringLiteral("osx");
+# endif
#elif defined(Q_OS_DARWIN)
return QStringLiteral("darwin");
@@ -3198,12 +3202,16 @@ static QBasicMutex environmentMutex;
Returns the value of the environment variable with name \a
varName. To get the variable string, use QByteArray::constData().
+ To convert the data to a QString use QString::fromLocal8Bit().
\note qgetenv() was introduced because getenv() from the standard
C library was deprecated in VC2005 (and later versions). qgetenv()
uses the new replacement function in VC, and calls the standard C
library's implementation on all other platforms.
+ \warning Don't use qgetenv on Windows if the content may contain
+ non-US-ASCII characters, like file paths.
+
\sa qputenv(), qEnvironmentVariableIsSet(), qEnvironmentVariableIsEmpty()
*/
QByteArray qgetenv(const char *varName)