--- a/src/corelib/global/qglobal.cpp Tue Jul 06 15:10:48 2010 +0300
+++ b/src/corelib/global/qglobal.cpp Wed Aug 18 10:37:55 2010 +0300
@@ -1623,7 +1623,7 @@
\macro Q_WS_S60
\relates <QtGlobal>
- Defined on S60.
+ Defined on S60 with the Avkon UI framework.
\sa Q_WS_MAC, Q_WS_WIN, Q_WS_X11, Q_WS_QWS
*/
@@ -1814,7 +1814,6 @@
#endif
#ifdef Q_OS_SYMBIAN
-# ifdef Q_WS_S60
static QSysInfo::S60Version cachedS60Version = QSysInfo::S60Version(-1);
QSysInfo::S60Version QSysInfo::s60Version()
@@ -1886,17 +1885,6 @@
return SV_Unknown;
}
}
-#else
-QSysInfo::S60Version QSysInfo::s60Version()
-{
- return SV_S60_None;
-}
-
-QSysInfo::SymbianVersion QSysInfo::symbianVersion()
-{
- return SV_Unknown;
-}
-# endif // ifdef Q_WS_S60
#endif // ifdef Q_OS_SYMBIAN
/*!
@@ -2518,6 +2506,19 @@
// getenv is declared as deprecated in VS2005. This function
// makes use of the new secure getenv function.
+/*!
+ \relates <QtGlobal>
+
+ Returns the value of the environment variable with name \a
+ varName. To get the variable string, use QByteArray::constData().
+
+ \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.
+
+ \sa qputenv()
+*/
QByteArray qgetenv(const char *varName)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -2537,6 +2538,20 @@
#endif
}
+/*!
+ \relates <QtGlobal>
+
+ This function sets the \a value of the environment variable named
+ \a varName. It will create the variable if it does not exist. It
+ returns 0 if the variable could not be set.
+
+ \note qputenv() was introduced because putenv() from the standard
+ C library was deprecated in VC2005 (and later versions). qputenv()
+ uses the replacement function in VC, and calls the standard C
+ library's implementation on all other platforms.
+
+ \sa qgetenv()
+*/
bool qputenv(const char *varName, const QByteArray& value)
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
@@ -2606,55 +2621,6 @@
#endif
}
-/*! \internal
- \relates <QtGlobal>
- \since 4.6
-
- Seed the PRNG, but only if it has not already been seeded.
-
- The default seed is a combination of current time, a stack address and a
- serial counter (since thread stack addresses are re-used).
-*/
-void qsrand()
-{
-#if (defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
- SeedStorage *seedStorage = randTLS();
- if (seedStorage) {
- SeedStorageType *pseed = seedStorage->localData();
- if (pseed) {
- // already seeded
- return;
- }
- seedStorage->setLocalData(pseed = new SeedStorageType);
- // start beyond 1 to avoid the sequence reset
- static QBasicAtomicInt serial = Q_BASIC_ATOMIC_INITIALIZER(2);
- *pseed = QDateTime::currentDateTime().toTime_t()
- + quintptr(&pseed)
- + serial.fetchAndAddRelaxed(1);
-#if defined(Q_OS_WIN) || defined(Q_OS_SYMBIAN)
- // for Windows and Symbian the srand function must still be called.
- srand(*pseed);
-#endif
- }
-
-//QT_NO_THREAD implementations
-#else
- static unsigned int seed = 0;
-
- if (seed)
- return;
-
-#if defined(Q_OS_SYMBIAN)
- seed = Math::Random();
-#elif defined(Q_OS_WIN)
- seed = GetTickCount();
-#else
- seed = quintptr(&seed) + QDateTime::currentDateTime().toTime_t();
-#endif
- srand(seed);
-#endif // defined(Q_OS_UNIX) || defined(Q_OS_WIN)) && !defined(QT_NO_THREAD)
-}
-
/*!
\relates <QtGlobal>
\since 4.2