diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2014-10-27 13:22:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-10-28 10:32:06 +0100 |
commit | af3bd5037aeb9b842193f0e21cd5c03572b6dac6 (patch) | |
tree | 7ce55202a0d40b75b18da24722d373376142d206 /src/corelib | |
parent | 5adbb9cc576546c42249099e549f1947cca54610 (diff) | |
parent | 2eb26c170920d28213b71e549d5dac4663febb14 (diff) |
Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/codecs/qicucodec.cpp | 2 | ||||
-rw-r--r-- | src/corelib/codecs/qtextcodec.cpp | 7 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 14 | ||||
-rw-r--r-- | src/corelib/io/qfile.cpp | 12 | ||||
-rw-r--r-- | src/corelib/io/qfiledevice.cpp | 5 | ||||
-rw-r--r-- | src/corelib/io/qloggingcategory.cpp | 23 | ||||
-rw-r--r-- | src/corelib/kernel/qmetatype.h | 15 | ||||
-rw-r--r-- | src/corelib/kernel/qtranslator.cpp | 5 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.cpp | 20 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 6 |
10 files changed, 75 insertions, 34 deletions
diff --git a/src/corelib/codecs/qicucodec.cpp b/src/corelib/codecs/qicucodec.cpp index 103bf0573f..a549430649 100644 --- a/src/corelib/codecs/qicucodec.cpp +++ b/src/corelib/codecs/qicucodec.cpp @@ -445,6 +445,8 @@ QTextCodec *QIcuCodec::codecForNameUnlocked(const char *name) // backwards compatibility with Qt 4.x if (!qstrcmp(name, "CP949")) name = "windows-949"; + else if (!qstrcmp(name, "Apple Roman")) + name = "macintosh"; // these are broken data in ICU 4.4, and can't be resolved even though they are aliases to tis-620 if (!qstrcmp(name, "windows-874-2000") || !qstrcmp(name, "windows-874") diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp index 519570c499..9d13e1b892 100644 --- a/src/corelib/codecs/qtextcodec.cpp +++ b/src/corelib/codecs/qtextcodec.cpp @@ -346,13 +346,13 @@ QTextCodec::ConverterState::~ConverterState() The supported encodings are: \list - \li Apple Roman \li \l{Big5 Text Codec}{Big5} \li \l{Big5-HKSCS Text Codec}{Big5-HKSCS} \li CP949 \li \l{EUC-JP Text Codec}{EUC-JP} \li \l{EUC-KR Text Codec}{EUC-KR} - \li \l{GBK Text Codec}{GB18030-0} + \li \l{GBK Text Codec}{GB18030} + \li HP-ROMAN8 \li IBM 850 \li IBM 866 \li IBM 874 @@ -360,10 +360,9 @@ QTextCodec::ConverterState::~ConverterState() \li ISO 8859-1 to 10 \li ISO 8859-13 to 16 \li Iscii-Bng, Dev, Gjr, Knd, Mlm, Ori, Pnj, Tlg, and Tml - \li JIS X 0201 - \li JIS X 0208 \li KOI8-R \li KOI8-U + \li Macintosh \li \l{Shift-JIS Text Codec}{Shift-JIS} \li TIS-620 \li \l{TSCII Text Codec}{TSCII} diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 044ba66a4c..4e074bcdb5 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -159,11 +159,10 @@ \value AA_UseHighDpiPixmaps Make QIcon::pixmap() generate high-dpi pixmaps that can be larger than the requested size. Such pixmaps will have - devicePixelRatio set to a value higher than 1. - - After setting this attribute application code that uses pixmap - sizes in layout geometry calculations should typically divide by - QPixmap::devicePixelRatio() to get device-independent layout geometry. + devicePixelRatio set to a value higher than 1. After setting this + attribute application code that uses pixmap sizes in layout geometry + calculations should typically divide by QPixmap::devicePixelRatio() + to get device-independent layout geometry. \value AA_ForceRasterWidgets Make top-level widgets use pure raster surfaces, and do not support non-native GL-based child widgets. @@ -183,7 +182,7 @@ \l{http://www.mesa3d.org/llvmpipe.html}{Mesa llvmpipe}, providing OpenGL 2.1. The value may have no effect if no such OpenGL implementation is available. The default name of this library is - QtSoftwareOpenGL.dll and can be overridden by setting the environment + opengl32sw.dll and can be overridden by setting the environment variable \e QT_OPENGL_DLL. See the platform-specific pages, for instance \l{Qt for Windows}, for more information. This value has been added in Qt 5.4. @@ -191,7 +190,8 @@ \value AA_ShareOpenGLContexts Enables resource sharing between the OpenGL contexts used by classes like QOpenGLWidget and QQuickWidget. This allows sharing OpenGL resources, like textures, between QOpenGLWidget - instances that belong to different top-level windows. + instances that belong to different top-level windows. This value has + been added in Qt 5.4. The following values are obsolete: diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 6fe4c2455b..d3411abf10 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -206,6 +206,13 @@ QAbstractFileEngine *QFilePrivate::engine() const directory usually is not writable, but it is still possible to create files in it. + Qt's understanding of file permissions is limited, which affects especially + the \l QFile::setPermissions() function. On Windows, Qt will set only the + legacy read-only flag, and that only when none of the Write* flags are + passed. Qt does not manipulate access control lists (ACLs), which makes this + function mostly useless for NTFS volumes. It may still be of use for USB + sticks that use VFAT file systems. POSIX ACLs are not manipulated, either. + \sa QTextStream, QDataStream, QFileInfo, QDir, {The Qt Resource System} */ @@ -1063,9 +1070,12 @@ QFile::permissions(const QString &fileName) /*! Sets the permissions for the file to the \a permissions specified. - Returns \c true if successful, or false if the permissions cannot be + Returns \c true if successful, or \c false if the permissions cannot be modified. + \warning This function does not manipulate ACLs, which may limit its + effectiveness. + \sa permissions(), setFileName() */ diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp index 8d1c59e159..598347a56f 100644 --- a/src/corelib/io/qfiledevice.cpp +++ b/src/corelib/io/qfiledevice.cpp @@ -648,9 +648,12 @@ QFile::Permissions QFileDevice::permissions() const /*! Sets the permissions for the file to the \a permissions specified. - Returns \c true if successful, or false if the permissions cannot be + Returns \c true if successful, or \c false if the permissions cannot be modified. + \warning This function does not manipulate ACLs, which may limit its + effectiveness. + \sa permissions() */ bool QFileDevice::setPermissions(Permissions permissions) diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp index 37503e032c..fef48a9040 100644 --- a/src/corelib/io/qloggingcategory.cpp +++ b/src/corelib/io/qloggingcategory.cpp @@ -61,13 +61,15 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \brief The QLoggingCategory class represents a category, or 'area' in the logging infrastructure. - QLoggingCategory represents a certain logging category - identified - by a string - at runtime. Whether a category should be actually logged or - not can be checked with the \l isEnabled() methods. + QLoggingCategory represents a certain logging category - identified by a + string - at runtime. A category can be configured to enable or disable + logging of messages per message type. Whether a message type is enabled or + not can be checked with the \l isDebugEnabled(), \l isWarningEnabled(), and + \l isCriticalEnabled() methods. All objects are meant to be configured by a common registry (see also \l{Configuring Categories}). Different objects can also represent the same - category. It's therefore not recommended to export objects across module + category. It is therefore not recommended to export objects across module boundaries, nor to manipulate the objects directly, nor to inherit from QLoggingCategory. @@ -110,8 +112,9 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \section2 Logging Rules - Logging rules allow to enable or disable logging for categories in a flexible - way. Rules are specified in text, where every line must have the format + Logging rules allow logging for categories to be enabled or disabled in a + flexible way. Rules are specified in text, where every line must have the + format \code <category>[.<type>] = true|false @@ -120,12 +123,12 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \c <category> is the name of the category, potentially with \c{*} as a wildcard symbol as the first or last character (or at both positions). The optional \c <type> must be either \c debug, \c warning, or \c critical. - Lines that do not fit to his scheme are ignored. + Lines that do not fit this scheme are ignored. Rules are evaluated in text order, from first to last. That is, if two rules apply to a category/type, the rule that comes later is applied. - Rules can be set via \l setFilterRules(). Since Qt 5.3 logging rules can also + Rules can be set via \l setFilterRules(). Since Qt 5.3, logging rules can also be set in the \c QT_LOGGING_RULES environment variable, and are automatically loaded from the \c [Rules] section of a logging configuration file. Such configuration files are looked up in the QtProject @@ -168,13 +171,13 @@ static void setBoolLane(QBasicAtomicInt *atomic, bool enable, int shift) \section2 Installing a Custom Filter - As a lower-level alternative to the text rules you can also implement a + As a lower-level alternative to the text rules, you can also implement a custom filter via \l installFilter(). All filter rules are ignored in this case. \section1 Printing the Category - Use the \c %{category} place holder to print the category in the default + Use the \c %{category} placeholder to print the category in the default message handler: \snippet qloggingcategory/main.cpp 3 diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index 53bfa769ac..08b2fb083a 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2112,6 +2112,21 @@ namespace QtPrivate { }; } +namespace QtMetaTypePrivate { +inline Q_DECL_CONSTEXPR bool isBuiltinSequentialType(int typeId) +{ + return typeId == qMetaTypeId<QStringList>() + || typeId == qMetaTypeId<QByteArrayList>() + || typeId == qMetaTypeId<QVariantList>(); +} + +inline Q_DECL_CONSTEXPR bool isBuiltinAssociativeType(int typeId) +{ + return typeId == qMetaTypeId<QVariantHash>() + || typeId == qMetaTypeId<QVariantMap>(); +} +} // QtMetaTypePrivate + QT_END_NAMESPACE #endif // QMETATYPE_H diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index d0fa0613b3..33827926c6 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -1086,6 +1086,11 @@ void QTranslatorPrivate::clear() \a disambiguation). If none is found, also tries (\a context, \a sourceText, ""). If that still fails, returns a null string. + \note Incomplete translations may result in unexpected behavior: + If no translation for (\a context, \a sourceText, "") + is provided, the method might in this case actually return a + translation for a different \a disambiguation. + If \a n is not -1, it is used to choose an appropriate form for the translation (e.g. "%n file found" vs. "%n files found"). diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index cea893ba0c..2ac1bb11fb 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -3632,11 +3632,13 @@ QSequentialIterable::const_iterator::const_iterator(const const_iterator &other) QSequentialIterable::const_iterator& QSequentialIterable::const_iterator::operator=(const const_iterator &other) { - if (!m_impl.equal(other.m_impl)) { - m_impl = other.m_impl; - ref = other.ref; + other.ref->ref(); + if (!ref->deref()) { + m_impl.destroyIter(); + delete ref; } - ref->ref(); + m_impl = other.m_impl; + ref = other.ref; return *this; } @@ -3941,11 +3943,13 @@ QAssociativeIterable::const_iterator::const_iterator(const const_iterator &other QAssociativeIterable::const_iterator& QAssociativeIterable::const_iterator::operator=(const const_iterator &other) { - if (!m_impl.equal(other.m_impl)) { - m_impl = other.m_impl; - ref = other.ref; + other.ref->ref(); + if (!ref->deref()) { + m_impl.destroyIter(); + delete ref; } - ref->ref(); + m_impl = other.m_impl; + ref = other.ref; return *this; } diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index bdbd0dd8ef..57e0523f7c 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -736,7 +736,7 @@ namespace QtPrivate { { static QVariantList invoke(const QVariant &v) { - if (v.userType() == qMetaTypeId<QStringList>() || v.userType() == qMetaTypeId<QByteArrayList>() || QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>())) { + if (QtMetaTypePrivate::isBuiltinSequentialType(v.userType()) || QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QSequentialIterableImpl>())) { QSequentialIterable iter = QVariantValueHelperInterface<QSequentialIterable>::invoke(v); QVariantList l; l.reserve(iter.size()); @@ -752,7 +752,7 @@ namespace QtPrivate { { static QVariantHash invoke(const QVariant &v) { - if (QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) { + if (QtMetaTypePrivate::isBuiltinAssociativeType(v.userType()) || QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) { QAssociativeIterable iter = QVariantValueHelperInterface<QAssociativeIterable>::invoke(v); QVariantHash l; l.reserve(iter.size()); @@ -768,7 +768,7 @@ namespace QtPrivate { { static QVariantMap invoke(const QVariant &v) { - if (QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) { + if (QtMetaTypePrivate::isBuiltinAssociativeType(v.userType()) || QMetaType::hasRegisteredConverterFunction(v.userType(), qMetaTypeId<QtMetaTypePrivate::QAssociativeIterableImpl>())) { QAssociativeIterable iter = QVariantValueHelperInterface<QAssociativeIterable>::invoke(v); QVariantMap l; for (QAssociativeIterable::const_iterator it = iter.begin(), end = iter.end(); it != end; ++it) |