summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-08-29 13:51:16 +0200
committerLiang Qi <liang.qi@qt.io>2016-08-29 15:30:17 +0200
commit1cc571593a67f3e688a5cbb896f0be71ca5a2b30 (patch)
treec652360c9276cbf475244fd02313d64e3df11a96 /src/corelib
parent829c59aa4acf94bd979f6a3162808be36802d79a (diff)
parentcc74452d6d259d36ac47c536f11a5efb269e8e44 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
cf53aa21bf0f8fbd13c0ce2d33ddf7bc63d0d76a and 3aaa5d6b32130d3eeac872a59a5a44bfb20dfd4a were reverted because of reconstruction in 5.7. defineTest(qtConfTest_checkCompiler) in configure.pri is smart enough to cover the case in a9474d1260a8c8cc9eae14f2984098919d9684e5. DirectWrite: Fix advances being scaled to 0 Since 131eee5cd, the stretch of a font can be 0, meaning "whatever the font provides". In combination with ec7fee96, this would cause advances in the DirectWrite engine to be scaled to 0, causing the QRawFont test to fail. Conflicts: configure mkspecs/features/uikit/device_destinations.sh mkspecs/features/uikit/xcodebuild.mk src/corelib/global/qglobal.cpp src/corelib/global/qnamespace.qdoc src/plugins/platforms/cocoa/qcocoamenuitem.h src/plugins/platforms/windows/qwindowsservices.cpp src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp src/widgets/kernel/qapplication.cpp tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp tests/auto/widgets/dialogs/qfiledialog2/tst_qfiledialog2.cpp Change-Id: I4656d8133da7ee9fcc84ad3f1c7950f924432d1e
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/arch/qatomic_cxx11.h26
-rw-r--r--src/corelib/global/qglobal.cpp14
-rw-r--r--src/corelib/global/qnamespace.qdoc5
-rw-r--r--src/corelib/io/qfile.cpp5
-rw-r--r--src/corelib/io/qfiledevice.cpp7
-rw-r--r--src/corelib/io/qfileinfo.cpp3
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp41
-rw-r--r--src/corelib/io/qfsfileengine.cpp5
-rw-r--r--src/corelib/io/qprocess.cpp15
-rw-r--r--src/corelib/io/qsettings.cpp24
-rw-r--r--src/corelib/json/qjson_p.h54
-rw-r--r--src/corelib/json/qjsonvalue.h2
-rw-r--r--src/corelib/kernel/qcoreevent.cpp2
-rw-r--r--src/corelib/mimetypes/qmimetype.cpp6
-rw-r--r--src/corelib/thread/qfutureinterface.cpp11
-rw-r--r--src/corelib/thread/qmutex.cpp27
-rw-r--r--src/corelib/tools/qdatetime.cpp5
-rw-r--r--src/corelib/tools/qlinkedlist.h4
-rw-r--r--src/corelib/tools/qlocale_tools.cpp2
-rw-r--r--src/corelib/tools/qlocale_win.cpp5
20 files changed, 113 insertions, 150 deletions
diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h
index 9658aca37c..63b23b71ab 100644
--- a/src/corelib/arch/qatomic_cxx11.h
+++ b/src/corelib/arch/qatomic_cxx11.h
@@ -73,7 +73,7 @@ QT_END_NAMESPACE
// ### Qt 6: make non-constexpr (see above)
template <int N> struct QAtomicTraits
-{ static Q_DECL_CONSTEXPR inline bool isLockFree() Q_DECL_NOTHROW; };
+{ static Q_DECL_CONSTEXPR inline bool isLockFree(); };
#define Q_ATOMIC_INT32_IS_SUPPORTED
#if ATOMIC_INT_LOCK_FREE == 2
@@ -86,7 +86,7 @@ template <int N> struct QAtomicTraits
# define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_ALWAYS_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree()
{ return true; }
#elif ATOMIC_INT_LOCK_FREE == 1
# define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
@@ -98,7 +98,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree()
{ return false; }
#else
# define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NEVER_NATIVE
@@ -110,7 +110,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT32_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT32_FETCH_AND_ADD_IS_NEVER_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<4>::isLockFree()
{ return false; }
#endif
@@ -139,7 +139,7 @@ template<> struct QAtomicOpsSupport<1> { enum { IsSupported = 1 }; };
# define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_ALWAYS_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree()
{ return true; }
#elif ATOMIC_CHAR_LOCK_FREE == 1
# define Q_ATOMIC_INT8_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
@@ -147,7 +147,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree()
{ return false; }
#else
# define Q_ATOMIC_INT8_REFERENCE_COUNTING_IS_NEVER_NATIVE
@@ -155,7 +155,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<1>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT8_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT8_FETCH_AND_ADD_IS_NEVER_NATIVE
-template <> Q_DECL_CONSTEXPR bool QAtomicTraits<1>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR bool QAtomicTraits<1>::isLockFree()
{ return false; }
#endif
@@ -167,7 +167,7 @@ template<> struct QAtomicOpsSupport<2> { enum { IsSupported = 1 }; };
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_ALWAYS_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree()
{ return false; }
#elif ATOMIC_SHORT_LOCK_FREE == 1
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
@@ -175,7 +175,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree()
{ return false; }
#else
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_NEVER_NATIVE
@@ -183,7 +183,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_NEVER_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<2>::isLockFree()
{ return false; }
#endif
@@ -196,7 +196,7 @@ template<> struct QAtomicOpsSupport<8> { enum { IsSupported = 1 }; };
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_ALWAYS_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_ALWAYS_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return true; }
# elif ATOMIC_LLONG_LOCK_FREE == 1
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_SOMETIMES_NATIVE
@@ -204,7 +204,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_SOMETIMES_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_SOMETIMES_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return false; }
# else
# define Q_ATOMIC_INT16_REFERENCE_COUNTING_IS_NEVER_NATIVE
@@ -212,7 +212,7 @@ template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() Q_DECL_N
# define Q_ATOMIC_INT16_FETCH_AND_STORE_IS_NEVER_NATIVE
# define Q_ATOMIC_INT16_FETCH_AND_ADD_IS_NEVER_NATIVE
-template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree() Q_DECL_NOTHROW
+template <> Q_DECL_CONSTEXPR inline bool QAtomicTraits<8>::isLockFree()
{ return false; }
# endif
#endif
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 284e833f73..5687920c9b 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1165,7 +1165,7 @@ bool qSharedBuild() Q_DECL_NOTHROW
\value WV_10_0 Operating system version 10.0, corresponds to Windows 10, introduced in Qt 5.5
The following masks can be used for testing whether a Windows
- version is MS-DOS-based, NT-based, or CE-based:
+ version is MS-DOS-based or NT-based:
\value WV_DOS_based MS-DOS-based version of Windows
\value WV_NT_based NT-based version of Windows
@@ -1297,14 +1297,14 @@ bool qSharedBuild() Q_DECL_NOTHROW
\relates <QtGlobal>
Defined on all supported versions of Windows. That is, if
- \l Q_OS_WIN32, \l Q_OS_WIN64 or \l Q_OS_WINRT is defined.
+ \l Q_OS_WIN32, \l Q_OS_WIN64, or \l Q_OS_WINRT is defined.
*/
/*!
\macro Q_OS_WIN32
\relates <QtGlobal>
- Defined on 32-bit and 64-bit versions of Windows (not on Windows CE).
+ Defined on 32-bit and 64-bit versions of Windows.
*/
/*!
@@ -2563,11 +2563,11 @@ static QString unknownText()
so applications can rely on the returned value as an identifier, except
that new OS kernel types may be added over time.
- On Windows, this function returns the type of Windows kernel, like "wince"
- or "winnt". On Unix systems, it returns the same as the output of \c{uname
+ On Windows, this function returns the type of Windows kernel, like "winnt".
+ On Unix systems, it returns the same as the output of \c{uname
-s} (lowercased).
- Note that this function may return surprising values: it returns "linux"
+ \note This function may return surprising values: it returns "linux"
for all operating systems running Linux (including Android), "qnx" for all
operating systems running QNX, "freebsd" for
Debian/kFreeBSD, and "darwin" for \macos and iOS. For information on the type
@@ -2644,7 +2644,7 @@ QString QSysInfo::kernelVersion()
"unknown" otherwise.
\b{Windows note}: this function returns "winphone" for builds for Windows
- Phone, "winrt" for WinRT builds and "windows" for normal desktop builds.
+ Phone, "winrt" for WinRT builds, and "windows" for normal desktop builds.
For other Unix-type systems, this function usually returns "unknown".
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index bf55693e8a..d8df25dcc6 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -137,7 +137,7 @@
\value AA_DontUseNativeMenuBar All menubars created while this attribute is
set to true won't be used as a native menubar (e.g, the menubar at
- the top of the main screen on \macos or at the bottom in Windows CE).
+ the top of the main screen on \macos).
\value AA_MacDontSwapCtrlAndMeta On \macos by default, Qt swaps the
Control and Meta (Command) keys (i.e., whenever Control is pressed, Qt
@@ -930,9 +930,6 @@
\value WA_InputMethodEnabled Enables input methods for Asian languages.
Must be set when creating custom text editing widgets.
- On Windows CE this flag can be used in addition to
- QApplication::autoSipEnabled to automatically display the SIP when
- entering a widget.
\value WA_KeyboardFocusChange Set on a toplevel window when
the users changes focus with the keyboard (tab, backtab, or shortcut).
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 9b1bd3a411..41fae69bb2 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -923,8 +923,6 @@ bool QFile::open(OpenMode mode)
you cannot use this QFile with a QFileInfo.
\endlist
- \note For Windows CE you may not be able to call resize().
-
\sa close()
\b{Note for the Windows Platform}
@@ -992,9 +990,6 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags)
those cases, size() returns \c 0. See QIODevice::isSequential()
for more information.
- \warning For Windows CE you may not be able to call seek(), and size()
- returns \c 0.
-
\warning Since this function opens the file without specifying the file name,
you cannot use this QFile with a QFileInfo.
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index a2119b74db..20cfa5bdaf 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -255,8 +255,6 @@ bool QFileDevice::isSequential() const
If the file is not open, or there is an error, handle() returns -1.
- This function is not supported on Windows CE.
-
\sa QSocketNotifier
*/
int QFileDevice::handle() const
@@ -681,8 +679,7 @@ bool QFileDevice::setPermissions(Permissions permissions)
be written to disk. Any such modifications will be lost when the
memory is unmapped. It is unspecified whether modifications made
to the file made after the mapping is created will be visible through
- the mapped memory. This flag is not supported on Windows CE.
- This enum value was introduced in Qt 5.4.
+ the mapped memory. This enum value was introduced in Qt 5.4.
*/
/*!
@@ -700,8 +697,6 @@ bool QFileDevice::setPermissions(Permissions permissions)
Returns a pointer to the memory or 0 if there is an error.
- \note On Windows CE 5.0 the file will be closed before mapping occurs.
-
\sa unmap()
*/
uchar *QFileDevice::map(qint64 offset, qint64 size, MemoryMapFlags flags)
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 8b9efb638a..baf8cbd193 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -713,9 +713,6 @@ bool QFileInfo::exists(const QString &file)
/*!
Refreshes the information about the file, i.e. reads in information
from the file system the next time a cached property is fetched.
-
- \note On Windows CE, there might be a delay for the file system driver
- to detect changes on the file.
*/
void QFileInfo::refresh()
{
diff --git a/src/corelib/io/qfilesystemwatcher.cpp b/src/corelib/io/qfilesystemwatcher.cpp
index d3aef27296..a1d90c76f4 100644
--- a/src/corelib/io/qfilesystemwatcher.cpp
+++ b/src/corelib/io/qfilesystemwatcher.cpp
@@ -174,26 +174,27 @@ void QFileSystemWatcherPrivate::_q_directoryChanged(const QString &path, bool re
they have been renamed or removed from disk, and directories once
they have been removed from disk.
- \note On systems running a Linux kernel without inotify support,
- file systems that contain watched paths cannot be unmounted.
-
- \note Windows CE does not support directory monitoring by
- default as this depends on the file system driver installed.
-
- \note The act of monitoring files and directories for
- modifications consumes system resources. This implies there is a
- limit to the number of files and directories your process can
- monitor simultaneously. On all BSD variants, for
- example, an open file descriptor is required for each monitored
- file. Some system limits the number of open file descriptors to 256
- by default. This means that addPath() and addPaths() will fail if
- your process tries to add more than 256 files or directories to
- the file system monitor. Also note that your process may have
- other file descriptors open in addition to the ones for files
- being monitored, and these other open descriptors also count in
- the total. \macos uses a different backend and does not
- suffer from this issue.
-
+ \list
+ \li \b Notes:
+ \list
+ \li On systems running a Linux kernel without inotify support,
+ file systems that contain watched paths cannot be unmounted.
+
+ \li The act of monitoring files and directories for
+ modifications consumes system resources. This implies there is a
+ limit to the number of files and directories your process can
+ monitor simultaneously. On all BSD variants, for
+ example, an open file descriptor is required for each monitored
+ file. Some system limits the number of open file descriptors to 256
+ by default. This means that addPath() and addPaths() will fail if
+ your process tries to add more than 256 files or directories to
+ the file system monitor. Also note that your process may have
+ other file descriptors open in addition to the ones for files
+ being monitored, and these other open descriptors also count in
+ the total. \macos uses a different backend and does not
+ suffer from this issue.
+ \endlist
+ \endlist
\sa QFile, QDir
*/
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 098bc49468..0b9cd0557f 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -880,9 +880,8 @@ bool QFSFileEngine::supportsExtension(Extension extension) const
/*! \fn QFileInfoList QFSFileEngine::drives()
For Windows, returns the list of drives in the file system as a list
- of QFileInfo objects. On Unix and Windows CE, only the
- root path is returned. On Windows, this function returns all drives
- (A:\, C:\, D:\, etc.).
+ of QFileInfo objects. On Unix, only the root path is returned.
+ On Windows, this function returns all drives (A:\, C:\, D:\, and so on).
For Unix, the list contains just the root path "/".
*/
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index f9b3b9fb00..23a3cc1a16 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -150,10 +150,6 @@ QT_BEGIN_NAMESPACE
On Windows, the variable names are case-insensitive, but case-preserving.
QProcessEnvironment behaves accordingly.
- On Windows CE, the concept of environment does not exist. This class will
- keep the values set for compatibility with other platforms, but the values
- set will have no effect on the processes being created.
-
\sa QProcess, QProcess::systemEnvironment(), QProcess::setProcessEnvironment()
*/
@@ -502,9 +498,6 @@ void QProcessPrivate::Channel::clear()
used as an input source for QXmlReader, or for generating data to
be uploaded using QNetworkAccessManager.
- \note On Windows CE, reading and writing to a process
- is not supported.
-
When the process exits, QProcess reenters the \l NotRunning state
(the initial state), and emits finished().
@@ -750,7 +743,7 @@ void QProcessPrivate::Channel::clear()
/*!
\typedef QProcess::CreateProcessArgumentModifier
- \note This typedef is only available on desktop Windows and Windows CE.
+ \note This typedef is only available on desktop Windows.
On Windows, QProcess uses the Win32 API function \c CreateProcess to
start child processes. While QProcess provides a comfortable way to start
@@ -1784,9 +1777,6 @@ void QProcess::setEnvironment(const QStringList &environment)
using setEnvironment(). If no environment has been set, the
environment of the calling process will be used.
- \note The environment settings are ignored on Windows CE,
- as there is no concept of an environment.
-
\sa processEnvironment(), setEnvironment(), systemEnvironment()
*/
QStringList QProcess::environment() const
@@ -1820,9 +1810,6 @@ void QProcess::setProcessEnvironment(const QProcessEnvironment &environment)
setEnvironment() or setProcessEnvironment(). If no environment has
been set, the environment of the calling process will be used.
- \note The environment settings are ignored on Windows CE,
- as there is no concept of an environment.
-
\sa setProcessEnvironment(), setEnvironment(), QProcessEnvironment::isEmpty()
*/
QProcessEnvironment QProcess::processEnvironment() const
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index ffcb2e2d72..8000dc5272 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -2235,16 +2235,20 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile,
On Windows, the following files are used:
\list 1
- \li \c{%APPDATA%\MySoft\Star Runner.ini}
- \li \c{%APPDATA%\MySoft.ini}
- \li \c{%COMMON_APPDATA%\MySoft\Star Runner.ini}
- \li \c{%COMMON_APPDATA%\MySoft.ini}
+ \li \c{CSIDL_APPDATA\MySoft\Star Runner.ini}
+ \li \c{CSIDL_APPDATA\MySoft.ini}
+ \li \c{CSIDL_COMMON_APPDATA\MySoft\Star Runner.ini}
+ \li \c{CSIDL_COMMON_APPDATA\MySoft.ini}
\endlist
- The \c %APPDATA% path is usually \tt{C:\\Documents and
- Settings\\\e{User Name}\\Application Data}; the \c
- %COMMON_APPDATA% path is usually \tt{C:\\Documents and
- Settings\\All Users\\Application Data}.
+ The identifiers prefixed by \c{CSIDL_} are special item ID lists to be passed
+ to the Win32 API function \c{SHGetSpecialFolderPath()} to obtain the
+ corresponding path.
+
+ \c{CSIDL_APPDATA} usually points to \tt{C:\\Users\\\e{User Name}\\AppData\\Roaming},
+ also shown by the environment variable \c{%APPDATA%}.
+
+ \c{CSIDL_COMMON_APPDATA} usually points to \tt{C:\\ProgramData}.
If the file format is IniFormat, this is "Settings/MySoft/Star Runner.ini"
in the application's home directory.
@@ -3348,8 +3352,8 @@ void QSettings::setUserIniPath(const QString &dir)
\table
\header \li Platform \li Format \li Scope \li Path
- \row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c %APPDATA%
- \row \li SystemScope \li \c %COMMON_APPDATA%
+ \row \li{1,2} Windows \li{1,2} IniFormat \li UserScope \li \c CSIDL_APPDATA
+ \row \li SystemScope \li \c CSIDL_COMMON_APPDATA
\row \li{1,2} Unix \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/.config
\row \li SystemScope \li \c /etc/xdg
\row \li{1,2} Qt for Embedded Linux \li{1,2} NativeFormat, IniFormat \li UserScope \li \c $HOME/Settings
diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h
index 1cffdbc250..4be62172a2 100644
--- a/src/corelib/json/qjson_p.h
+++ b/src/corelib/json/qjson_p.h
@@ -323,7 +323,7 @@ class Latin1String;
class String
{
public:
- String(const char *data) { d = (Data *)data; }
+ explicit String(const char *data) { d = (Data *)data; }
struct Data {
qle_int length;
@@ -397,7 +397,7 @@ public:
class Latin1String
{
public:
- Latin1String(const char *data) { d = (Data *)data; }
+ explicit Latin1String(const char *data) { d = (Data *)data; }
struct Data {
qle_short length;
@@ -438,26 +438,10 @@ public:
return *this;
}
- inline bool operator ==(const QString &str) const {
- return QLatin1String(d->latin1, d->length) == str;
- }
- inline bool operator !=(const QString &str) const {
- return !operator ==(str);
- }
- inline bool operator >=(const QString &str) const {
- return QLatin1String(d->latin1, d->length) >= str;
+ QLatin1String toQLatin1String() const Q_DECL_NOTHROW {
+ return QLatin1String(d->latin1, d->length);
}
- inline bool operator ==(const Latin1String &str) const {
- return d->length == str.d->length && !strcmp(d->latin1, str.d->latin1);
- }
- inline bool operator >=(const Latin1String &str) const {
- int l = qMin(d->length, str.d->length);
- int val = strncmp(d->latin1, str.d->latin1, l);
- if (!val)
- val = d->length - str.d->length;
- return val >= 0;
- }
inline bool operator<(const String &str) const
{
const qle_ushort *uc = (qle_ushort *) str.d->utf16;
@@ -488,6 +472,36 @@ public:
}
};
+#define DEF_OP(op) \
+ inline bool operator op(Latin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ { \
+ return lhs.toQLatin1String() op rhs.toQLatin1String(); \
+ } \
+ inline bool operator op(QLatin1String lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ { \
+ return lhs op rhs.toQLatin1String(); \
+ } \
+ inline bool operator op(Latin1String lhs, QLatin1String rhs) Q_DECL_NOTHROW \
+ { \
+ return lhs.toQLatin1String() op rhs; \
+ } \
+ inline bool operator op(const QString &lhs, Latin1String rhs) Q_DECL_NOTHROW \
+ { \
+ return lhs op rhs.toQLatin1String(); \
+ } \
+ inline bool operator op(Latin1String lhs, const QString &rhs) Q_DECL_NOTHROW \
+ { \
+ return lhs.toQLatin1String() op rhs; \
+ } \
+ /*end*/
+DEF_OP(==)
+DEF_OP(!=)
+DEF_OP(< )
+DEF_OP(> )
+DEF_OP(<=)
+DEF_OP(>=)
+#undef DEF_OP
+
inline bool String::operator ==(const Latin1String &str) const
{
if ((int)d->length != (int)str.d->length)
diff --git a/src/corelib/json/qjsonvalue.h b/src/corelib/json/qjsonvalue.h
index 1ce7f745e0..a853acaddd 100644
--- a/src/corelib/json/qjsonvalue.h
+++ b/src/corelib/json/qjsonvalue.h
@@ -82,7 +82,7 @@ public:
QJsonValue(QLatin1String s);
#ifndef QT_NO_CAST_FROM_ASCII
inline QT_ASCII_CAST_WARN QJsonValue(const char *s)
- : d(0), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
+ : d(Q_NULLPTR), t(String) { stringDataFromQStringHelper(QString::fromUtf8(s)); }
#endif
QJsonValue(const QJsonArray &a);
QJsonValue(const QJsonObject &o);
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index e3d0185004..64e73d23c5 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -213,7 +213,7 @@ QT_BEGIN_NAMESPACE
\value TabletMove Wacom tablet move (QTabletEvent).
\value TabletPress Wacom tablet press (QTabletEvent).
\value TabletRelease Wacom tablet release (QTabletEvent).
- \value OkRequest Ok button in decoration pressed. Supported only for Windows CE.
+ \omitvalue OkRequest
\value TabletEnterProximity Wacom tablet enter proximity event (QTabletEvent), sent to QApplication.
\value TabletLeaveProximity Wacom tablet leave proximity event (QTabletEvent), sent to QApplication.
\omitvalue ThemeChange
diff --git a/src/corelib/mimetypes/qmimetype.cpp b/src/corelib/mimetypes/qmimetype.cpp
index 5d18b67e8d..98a0e8eb1b 100644
--- a/src/corelib/mimetypes/qmimetype.cpp
+++ b/src/corelib/mimetypes/qmimetype.cpp
@@ -238,15 +238,15 @@ QString QMimeType::name() const
/*!
Returns the description of the MIME type to be displayed on user interfaces.
- The system language (QLocale::system().name()) is used to select the appropriate translation.
+ The default language (QLocale().name()) is used to select the appropriate translation.
*/
QString QMimeType::comment() const
{
QMimeDatabasePrivate::instance()->provider()->loadMimeTypePrivate(*d);
QStringList languageList;
- languageList << QLocale::system().name();
- languageList << QLocale::system().uiLanguages();
+ languageList << QLocale().name();
+ languageList << QLocale().uiLanguages();
for (const QString &language : qAsConst(languageList)) {
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
const QString comm = d->localeComments.value(lang);
diff --git a/src/corelib/thread/qfutureinterface.cpp b/src/corelib/thread/qfutureinterface.cpp
index 6690f28556..ce31fe9270 100644
--- a/src/corelib/thread/qfutureinterface.cpp
+++ b/src/corelib/thread/qfutureinterface.cpp
@@ -305,12 +305,11 @@ void QFutureInterfaceBase::waitForResult(int resultIndex)
lock.relock();
- if (!(d->state & Running))
- return;
-
- const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
- while ((d->state & Running) && d->internal_isResultReadyAt(waitIndex) == false)
- d->waitCondition.wait(&d->m_mutex);
+ if (d->state & Running) {
+ const int waitIndex = (resultIndex == -1) ? INT_MAX : resultIndex;
+ while ((d->state & Running) && d->internal_isResultReadyAt(waitIndex) == false)
+ d->waitCondition.wait(&d->m_mutex);
+ }
d->m_exceptionStore.throwPossibleException();
}
diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp
index 6dfe1ddc89..366413e82e 100644
--- a/src/corelib/thread/qmutex.cpp
+++ b/src/corelib/thread/qmutex.cpp
@@ -635,34 +635,11 @@ const int FreeListConstants::Sizes[FreeListConstants::BlockCount] = {
typedef QFreeList<QMutexPrivate, FreeListConstants> FreeList;
// We cannot use Q_GLOBAL_STATIC because it uses QMutex
-#if defined(Q_COMPILER_THREADSAFE_STATICS)
+static FreeList freeList_;
FreeList *freelist()
{
- static FreeList list;
- return &list;
+ return &freeList_;
}
-#else
-static QBasicAtomicPointer<FreeList> freeListPtr;
-
-FreeList *freelist()
-{
- FreeList *local = freeListPtr.loadAcquire();
- if (!local) {
- local = new FreeList;
- if (!freeListPtr.testAndSetRelease(0, local)) {
- delete local;
- local = freeListPtr.loadAcquire();
- }
- }
- return local;
-}
-
-static void qFreeListDeleter()
-{
- delete freeListPtr.load();
-}
-Q_DESTRUCTOR_FUNCTION(qFreeListDeleter)
-#endif
}
QMutexPrivate *QMutexPrivate::allocate()
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index a2c92835fe..e4b28178e8 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2997,9 +2997,8 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
QDateTime takes into account the system's time zone information
when dealing with DST. On modern Unix systems, this means it
applies the correct historical DST data whenever possible. On
- Windows and Windows CE, where the system doesn't support
- historical DST data, historical accuracy is not maintained with
- respect to DST.
+ Windows, where the system doesn't support historical DST data,
+ historical accuracy is not maintained with respect to DST.
The range of valid dates taking DST into account is 1970-01-01 to
the present, and rules are in place for handling DST correctly
diff --git a/src/corelib/tools/qlinkedlist.h b/src/corelib/tools/qlinkedlist.h
index 62cb17c053..249f76dafd 100644
--- a/src/corelib/tools/qlinkedlist.h
+++ b/src/corelib/tools/qlinkedlist.h
@@ -134,7 +134,7 @@ public:
typedef T *pointer;
typedef T &reference;
Node *i;
- inline iterator() : i(0) {}
+ inline iterator() : i(Q_NULLPTR) {}
inline iterator(Node *n) : i(n) {}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
iterator(const iterator &other) Q_DECL_NOTHROW : i(other.i) {}
@@ -171,7 +171,7 @@ public:
typedef const T *pointer;
typedef const T &reference;
Node *i;
- inline const_iterator() : i(0) {}
+ inline const_iterator() : i(Q_NULLPTR) {}
inline const_iterator(Node *n) : i(n) {}
inline const_iterator(iterator ci) : i(ci.i){}
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp
index 5fd2aa0c59..762f4f36dc 100644
--- a/src/corelib/tools/qlocale_tools.cpp
+++ b/src/corelib/tools/qlocale_tools.cpp
@@ -224,7 +224,7 @@ void doubleToAscii(double d, QLocaleData::DoubleForm form, int precision, char *
const char *endptr;
decpt = qstrtoll(target.data() + eSign + 1, &endptr, 10, &ok) + 1;
Q_ASSERT(ok);
- Q_ASSERT(endptr - target.data() <= length - eSign -1);
+ Q_ASSERT(endptr - target.data() <= length);
} else {
// No 'e' found, so it's the 'f' form. Variants of snprintf generate numbers with
// potentially multiple digits before the '.', but without decimal exponent then. So we
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index f8b9f86ac6..42ac888e47 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -826,7 +826,6 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
case ZeroDigit:
return d->zeroDigit();
case LanguageId:
- case ScriptId:
case CountryId: {
QString locale = QString::fromLatin1(getWinLocaleName());
QLocale::Language lang;
@@ -835,12 +834,12 @@ QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
QLocalePrivate::getLangAndCountry(locale, lang, script, cntry);
if (type == LanguageId)
return lang;
- if (type == ScriptId)
- return script == QLocale::AnyScript ? fallbackUiLocale().script() : script;
if (cntry == QLocale::AnyCountry)
return fallbackUiLocale().country();
return cntry;
}
+ case ScriptId:
+ return QVariant(QLocale::AnyScript);
case MeasurementSystem:
return d->measurementSystem();
case AMText: