summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* QSortFilterProxyModel: avoid some unnecessary copiesChristian Ehrlicher2019-07-311-34/+30
| | | | | | | | Clean up QSortFilterProxyModel by using const refs instead copies and range-based for loops instead plain loops Change-Id: Ic1250f33e7c311a9e1d3c19cc5dc7a9578423e74 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-07-303-21/+40
|\
| * Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-303-21/+40
| |\ | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/mingw_make.cpp Change-Id: I2f790bc8572bd22fea01edf7ca74595b29f063eb
| | * Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-302-19/+36
| | |\ | | | | | | | | | | | | Change-Id: Ibdbd88e11cd03d5ce558e67ad8e9a21436e7ef89
| | | * Move processOpenModeFlags out of QFSFileEngineOliver Wolff2019-07-292-19/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The same logic is needed for QWinRTFileEngine. To be able to reuse the code, it was moved out of the class. Task-number: QTBUG-77095 Change-Id: If52b2fc8a0f3056d32fc693775565a1c3803b7d4 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-291-2/+4
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qresource.cpp Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
| | | * QResource: fix nullptr-check gone tautologicalMarc Mutz2019-07-261-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends 136c5b9338f71775eb42528cfc7c23b2b4e5dff9. Before that change, each of the three members was a separate Q_GLOBAL_STATIC, so checking resourceList() for nullptr was the correct thing to do to find out whether the static was already destroyed. After the change, the resourceList() function will never return nullptr. Either resourceGlobalData.isDestroyed(), in which case dereferencing it asserts, or it isn't, in which case resourceList() returns a valid pointer. An explicit isDestroyed() check was added to the unregister function, but the register one was also checking resourceList() for nullptr, and this was left unprotected. Add the check and remove the now-tautological checks for nullptr resourceList(). Change-Id: I41fe66939ce858a77802b8af04c1de6e4fafe048 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QEasingCurve: reduce code duplication in setCurveShape()Marc Mutz2019-07-301-19/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of creating an explicit QEasingCurve object in each switched-over case, extract the conversion between the enums involved into a helper and just call setEasingCurve() with the result (implicitly converted to QEasingCurve). Saves 0.5KiB in text size on optimized AMD64 Linux GCC 9.1 builds. Change-Id: I81b5d7199d9dd99ba3735c910a50e371e0b99838 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QEasingCurve: remove a default case labelMarc Mutz2019-07-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A default: case label turns off compiler warnings for missing enumeration values, which we'd like to have, so remove it. Change-Id: I96247a7fc46e91a29591a907e52841a90df62f10 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Fix removal of QJsonObject properties when assigning undefinedSimon Hausmann2019-07-301-1/+4
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 8010e906d3612aface0daccde41d1a65fca04b0c accidentally ended up removing the removal-on-undefined-insertion check by calling insertAt instead of insert, which had it. This patch moves the check back into setValueAt. Change-Id: Ic381e284d3da37e31c4eb29f79dfab9c55c2e3e9 Fixes: QTBUG-77204 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | QStringView: clean up storage_typeMarc Mutz2019-07-292-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all supported compilers support char16_t, we don't need the storage_type == wchar_t hack for MSVC anymore. Remove it. Adapt docs. Change-Id: I55df6c8a9fa5a9c7e6f53ba89f3850956b369061 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | qstringalgorithms.h: add pure, noexcept, constexprMarc Mutz2019-07-293-7/+8
| | | | | | | | | | | | | | | | | | | | | ... where they were missing. Change-Id: I58c32e57675b5d5ee500722933ef4a356a679e46 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QStandardPaths: don't build a QHash just to look up one keyMarc Mutz2019-07-291-41/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code parses a file, looking for XDG_*_DIR entries and stores each one's key and raw value in a QHash. After parsing, it, however, looked up exactly once, by a key it could have known all along. So, move the key computation before the opening of the file, and look for the correct key directly, consciously striving to continue to find, as the old code implicitly did, the last entry, since man 5 user-dirs.dirs explains: > The format of user-dirs.dirs is designed to allow direct sourcing of > this file in shell scripts. Which means last one wins. Port to QStringView API of QRegularExpression, too. Change-Id: Ie92b689b5b9221df918c67b96f2f6a09827e7b1e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | | QEasingCurve: fix missing copy() overrideMarc Mutz2019-07-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TCBEase is-a BezierEase, but overrides value(). It only performs additional checks and then calls the base class' implementation, but it feels wrong, like a bug waiting to manifest itself, that slicing should occur on cloning a TCBEase. Fix by adding the missing reimplmentation. Change-Id: I2524f51fec1850ff36ed706bc79e9592734d8680 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | | QStringView: two fixes for newly-added toWCharArray()Marc Mutz2019-07-293-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amends e89fbd8c3aa50a24e5fc02ab710ccca67fce98e2. - While QString::data() never returns nullptr, QStringView::data() may, which makes calling QStringView{}.toWCharArray() UB on Windows (since memcpy's 2nd argument must never be nullptr, even if the size is zero). Fix by protecting the memcpy call. - QStringView, by design, does not use out-of-line member functions, because calling these forces the QStringView object onto the stack. Fix by making inline. Also use the more efficient qToStringViewIgnoringNull(), as the result does not depend on QString::isNull() (no characters are written either way), and add a missing article to the function's docs. Change-Id: I5d6b31361522812b0db8303b93c43d4b9ed11933 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Port from QStringViewLiteral to u""Marc Mutz2019-07-293-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Now that all our supported compilers know char16_t, we no longer need QStringViewLiteral, whose only purpose in life was to turn u"" into L"" for MSVC < 2015. Change-Id: I25a094fe7992d9d5dbeb4a524d9e99e043dcb8ce Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Standardize on unique_ptr to hold QAbstractFileEngineMarc Mutz2019-07-285-22/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | This will make it possible to return it from functions in an owner, as exemplified in the QFileInfoPrivate ctor, unlike QScopedPointer, which lacks move special member functions. Change-Id: I179ffa4f656e1b83c23e0f67d1542834460ff382 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Fix typo: s/QLocal/QLocale/Edward Welbourne2019-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This amends commit 1d8c9978fa1baafa17c95713bd5d04f245eeb76f in which I perpetrated this typo. Change-Id: Iccfc14aff7c4f3976b92919c8e8dc4b7906642ae Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Tidy up some messy code in QLocaleEdward Welbourne2019-07-261-24/+8
| | | | | | | | | | | | | | | | | | | | | | | | It was using if/else with extraneous braces, where simple ternary operators will do. It was doing a StringView content check clumsily when mid() and startsWith() suffice. Change-Id: I693f29ce5b425d53469d2c756fe27459f36470e9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Split all the over-long lines in qlocale.cppEdward Welbourne2019-07-251-56/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were many. Reflowed some documentation to 80 columns, split all code lines that exceeded 100 columns. Revised the splitting in a few cases that were inelegant or conflicted with our coding style. Added braces to some bodies of split control lines. Change-Id: I56eb9632f6399f0db1293477966f7d553f196a5b Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | QObject: replace QScopedPointer with std::unique_ptr in the implementationMarc Mutz2019-07-241-14/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the standard tool instead of self-made stuff that cannot decide whether it wants to be a scoped pointer (why take()?) or a movable one (why no move special member functions?). Take advantage of C++11 local structs for pulling the custom deleter into the scope where its only user is located, too. Change-Id: I7e097a59edef9adc8455504ae94b8df0f8b9e5d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Extend QString::arg(QString, ..., QString) to more than 9 argumentsMarc Mutz2019-07-242-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have QStringView::arg(), we can use it to implement a similarly flexible QString::arg(). It's not as straight-forward as in QStringView, though: QString has existing arg() overloads that all become worse matches with the introduction of the new, perfectly-forwarding overload. So in order to allow calling of the other arg() functions, first constrain the new arg() function to arguments that are convertible to QString, QStringView, or QLatin1String, and then delegate to the QStringView version. To stay compatible with the previous overloads, which accepted anything that implicitly converts to QString (in particular, QStringBuilder expressions), add a new overload of qStringLikeToView, taking const QString &. This benefits the existing QStringView and QLatin1View versions, too. [ChangeLog][QtCore][QString] QString::arg(QString, ..., QString) can now be called with more than nine arguments, as well as with QStringViews. Change-Id: I1e717a1bc696346808bcae45dc47762a492c8714 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-224-9/+30
|\| | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp Change-Id: Ib3715e626f2fd32804c75c16ea9aa06a1216e76d
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-204-9/+30
| |\| | | | | | | | | | Change-Id: Ic34021fbb87d689ee23a5d1b3f50617ada9ec9b9
| | * Fix QCborStreamReader not flushing QIODevices due to internal bufferingThiago Macieira2019-07-191-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When successfully finishing a parse, it's reasonable to expect that the QIODevice was advanced to the end of the input data. [ChangeLog][QtCore][QCborStreamReader] Fixed a bug that caused the QIODevice that the data was being read from not to show the entire CBOR message as consumed. This allows the user to consume data that may follow the CBOR payload. Fixes: QTBUG-77076 Change-Id: I1024ee42da0c4323953afffd15b23f5d8fcc6f50 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
| | * Fix QStorageInfo inability to parse really long mountinfo linesThiago Macieira2019-07-191-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Docker creates really long lines due to the multiple levels of overlays in the overlayfs. Our limit of 1024 bytes was too short. [ChangeLog][QtCore][QStorageInfo] Fixed a bug that caused QStorageInfo to be unable to report all filesystems if the options to mounted filesystems were too long (over 900 characters, roughly), such as those found in Docker overlay mounts. Fixes: QTBUG-77059 Change-Id: I6aed4df6a12e43c3ac8efffd15b1ba4231e60b4a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
| | * macOS: Allow overriding NSKeyValueObservingOptions for QMacKeyValueObserverTor Arne Vestbø2019-07-182-6/+9
| | | | | | | | | | | | | | | Change-Id: I6dc0f7c542ccfb768c1cd8688168c415e2c8a087 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QJsonObject: add QLatin1String overloads of non-const methodsMat Sutcliffe2019-07-203-44/+179
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also optimized the existing QL1S overload of non-const operator[](), and applied Extract Method refactoring to the other existing QL1S overloads. [ChangeLog][QtCore][QJsonObject] Added insert(), remove(), and take() overloads taking QLatin1String. Change-Id: I5e737cf2d7d9ffb325d6981db1e4a6a9f093657b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | JSON: add some QStringView overloadsMat Sutcliffe2019-07-208-37/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][JSON] Added overloads of functions taking key strings as QStringView; in QJsonObject, QJsonValue and QJsonDocument. Change-Id: I78b40aba8200003acfae257ff06f5f15737005e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
* | | QJsonObject: minor refactoringMat Sutcliffe2019-07-202-16/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | Applied DRY principle. Change-Id: Ic3035552c6174167b4fe19fd4c825500dff16ded Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Optimize non-const overload of QJsonObject::operator[]Mat Sutcliffe2019-07-202-6/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactored parts of insert() into a new private method insertAt(), which can also be called by operator[]() to avoid a redundant key lookup. This is in preparation for overloading QJsonObject's non-const methods on QLatin1String. As a bonus, this also avoids a redundant key lookup in QJsonValueRef::operator=(). Change-Id: Ic481981d838e50bc55fb8e7844536749781899ce Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QFile: hold engine by unique_ptrMarc Mutz2019-07-195-53/+42
| | | | | | | | | | | | | | | | | | | | | | | | Unfortunately, we can't, yet, change QAbstractFileEngine::create() to return a unique_ptr. But we should do it in Qt 6. Change-Id: If18ff766bce73ecd4143274ac9f9a5a7b9d5912c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-193-23/+15
|\| | | | | | | | | | | Change-Id: I999ba23a27cd897017d15c6ffe41ea8cd008ffb9
| * | QStandardPaths: update docs to what $HOME is on iOSThiago Macieira2019-07-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It's not <APPROOT> (any more, or was ever). Fixes: QTBUG-76911 Change-Id: I6aed4df6a12e43c3ac8efffd15aed22128862c23 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-181-21/+13
| |\| | | | | | | | | | Change-Id: I685000c4f33fb3707b2102fae0b58092107dc8f0
| | * QDateTime docs: don't encourage use of deprecated textdate functionsEdward Welbourne2019-07-171-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The textdate API methods are deprecated in favor of QLocale; so suggest use of QLocale in place of them. Don't credit the deprecated methods as being used where they aren't. Change-Id: I0abcb1f69729760ae1b86cb8088e4158c0ad6010 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
| | * Work around Apple Clang's -Wshadow warningThiago Macieira2019-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Well, yeah, it technically does... qcborstream.h:245:15: warning: declaration shadows a typedef in the global namespace [-Wshadow] /usr/include/libkern/OSTypes.h:36:26: note: previous declaration is here Fixes: QTBUG-75825 Change-Id: Idce141629dd34287808bfffd159ee2a75428bf12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
| * | Fix regression causing QVector::fill w/ same size to not detachThiago Macieira2019-07-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caused by commit 01301b0b340df736dd1b0a54b3026e00b49c5ea3, which made vector.resize(vector.size()) not to detach, which was used by fill() and assumed that detaching happened. The test does not test the resize() behavior, only that fill() is not broken anymore. [ChangeLog][QtCore][QVector] Fixed a regression that caused fill() not to detach, corrupting shared copies. Fixes: QTBUG-77058 Change-Id: I6aed4df6a12e43c3ac8efffd15b1b527a8007bf3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QDir: strip Windows' long-path markers when converting from nativeVolker Hilsheimer2019-07-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications might receive paths with Windows' '\\?\' markers, which indicates a long path to Win32 APIs, when the application is opened by explorer via file association. Qt not ignoring those markers will fail to open such files. By stripping the marker in QDir::fromNativeSeparators, QFile, QFileInfo etc automatically are able to handle such paths. QDir::cleanPath is also documented to normalize separators, so it needs to be done there as well. [ChangeLog][QtCore][QDir] Remove Windows specific long path markers when handling file paths with native separators. Change-Id: I526a890614edee8c85b39fc12c98e7ddb6e0d793 Fixes: QTBUG-75117 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Qt Forward Merge Bot2019-07-173-7/+48
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-173-7/+48
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qlogging.cpp src/gui/painting/qtextureglyphcache_p.h src/gui/text/qfontengine.cpp src/widgets/widgets/qlineedit.cpp Change-Id: Ic8798538df466b7141caa8bbf1fb7605eb56be37
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-133-18/+65
| | |\| | | | | | | | | | | | | Change-Id: I5d2a4fa33b4aa22da39ac045e6b85ab940b8720b
| | | * Optimize and fix handling of QtMessageHandlersMarc Mutz2019-07-111-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A function may almost always have static storage duration, but that does not necessarily mean that we can store and load pointers to them without memory ordering. Play it safe and use store-release and load-acquire for them (which combines to ordered for the fetchAndSet call in qInstall*Handler(), as we don't know what the caller will do with the returned function pointer). Also change the initial value of the atomic pointer to nullptr. Nullptr already signified the default handler in qInstall*Handler(), so the API doesn't change. But by using nullptr to mean default, we place these variables in the BSS segment instead of TEXT, save dynamic init, or at least a relocation, and we dodge the smelly comparison of function pointers, using comparison against nullptr instead. Also, as a drive-by, put the call to ungrabMessageHandler() in a scope-guard. Both the message handler, as well as the Qt code calling it (toLocal8Bit()!), may throw, and that would stop all further logging. In Qt 5.9, we can't use qScopeGuard(), yet, so use a local struct calling ungrabMessageHandler() in its dtor. The code still has one problem: When a logging action is underway, and another thread exchanges the message handler, we might still execute code in the old handler. This is probably not a problem in practice, since no-one will use a dynamically-compiled function for logging (right? :), but should probably be documented or fixed. This patch does not address this issue, though. Change-Id: I21aa907288b9c8c6646787b4001002d145b114a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cd401b74a13cd9d9a47d977f195c7985cf725d55) (cherry picked from commit ea16c860bd75a35134ebb1d4f3be5db58f4a4e21)
| | | * QSaveFile: Fix changing the file name after hitting on readonly fileFriedemann Kleint2019-07-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call to QFileDevice::unsetError() in QSaveFile::open() does not clear QSaveFilePrivate::writeError. Clear it in addition. Fixes: QTBUG-77007 Change-Id: I5e5009750f1726d1c74c1b4eb1c33f3a5393fe4f Reviewed-by: David Faure <david.faure@kdab.com>
| | | * QDirIterator: don't require NFD normalization on Darwin for validityThiago Macieira2019-07-111-3/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HFS+ filesystems do enforce NFD normalization, so the test worked for those filesystems. But on APFS, the filesystem is normalization- insensitive but preserves it, so our transformation caused valid files to be rejected. This commit also optimizes the solution for all systems too. Instead of converting from 8-bit to UTF-16 then back to 8-bit (allocating memory in both steps), we only convert to UTF-16. And if we detect the locale is UTF-8, then we use the further optimized QUtf8::isValidUtf8 function that doesn't allocate any memory at all (ditto for US-ASCII, the case of someone running with LANG=C). Fixes: QTBUG-76522 Change-Id: Ief874765cd7b43798de3fffd15aa0d81620ad317 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Merge "Merge remote-tracking branch 'origin/5.12' into 5.13"Qt Forward Merge Bot2019-07-122-4/+4
| | |\ \
| | | * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-122-4/+4
| | | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.pri Also required s/solid\.color/solidColor/ in a couple of places in: src/gui/painting/qpaintengine_raster.cpp Change-Id: I29937f63e9779deb6dac7ae77e2948d06ebc0319
| | | | * QFreeList: fix memory order on block deletionMarc Mutz2019-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blocks are likely to have been created in a differnt thread from the one performing their deletion, so we need an acquire fence. The rest of the atomics use in the class looks ok, but nevertheless warrants a deeper analysis. Change-Id: I1571ded3a06695b0d58b5bf1d80d6283ac21f959 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6fa34930c23c7494a3f2703777f46794ff091e2b) (cherry picked from commit 51bcc7e07e2bb5b42bb200dcd5269e9e9e2fe240) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | | | * QSimpleTextCodec: fix load memory order of atomic pointerMarc Mutz2019-07-081-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer value is not the only data we're interested in, but instead points to indirect data, so we need a release fence on store (present) and a corresponding acquire fence on load (was missing). Change-Id: I51f8251c0c7f4056192880430f2be5e0836dbed6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f84829031f318bfda1deff5f409b5ea6c6a5c5f) (cherry picked from commit 4cc6e1419294a729e53d698bace2254903c1429b) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
| | * | | QByteArray: Clarify that QByteArrays always use the Latin-1 encodingAndre Hartmann2019-07-121-4/+3
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... irrespective from the users current locale. Fixes: QTBUG-76938 Change-Id: I78810a75ecf9e9f1067363ce56656124b6ddcefd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>