summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* Update the DNS public suffix list from publicsuffix.orgEdward Welbourne2019-02-272-13620/+13653
| | | | | | | | | | | | | | | | Regular update in preparation for 5.13, adding tests for additions since 5.9.4/5.10.1/5.11.0's update 7e946030 (the last to record its upstream version sha1). Corrected the license header: it's now published under MPL 2.0 (not 1.1); and our secondary licensing of it is as LGPL3. Deferred full header over-haul until we've worked one out in detail. [ChangeLog][Third-Party Code] Updated DNS public suffix list Task-number: QTBUG-72623 Change-Id: Iabdbbbfd79624830396c2a6fe0a73389bd6ce5b7 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix can not -> cannotRobert Loehning2019-02-251-1/+1
| | | | | Change-Id: Ie9992f67ca59aff662a4be046ace08640e7c2714 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Update and expand public suffix list's attribution informationEdward Welbourne2019-02-221-2/+4
| | | | | | | | | | | Say where the git repo is, for finding commit IDs, but make clear that the download should come from the public site. Revised Description to the closest match to it I could find on the current web-site (on the home page). Mention where the script to convert the data live. Task-number: QTBUG-72623 Change-Id: Ie5f7b2b0c21cdf1c24e311c13866cb1bb02e6973 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-221-8/+14
|\ | | | | | | Change-Id: I9e7cb1b131b7b216aad8ed1b1536669fd1557c21
| * QProcess: Fix crash when calling closeWriteChannel on WindowsJoerg Bornemann2019-02-211-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | We must deleteLater the pipe writer in closeChannel, because if you call closeWriteChannel() from a slot that is connected to a signal emitted from QWindowsPipeWriter, we'd operate on a deleted object. For consistency, we're calling QWindowsPipeWriter::stop before deleteLater and deduplicate the code. Fixes: QTBUG-73778 Change-Id: I61d3dedf57e9fd02517a108d13ffc85e006330f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-02-211-1/+7
|\| | | | | | | Change-Id: I830beea26863323ab78a5d4b093f7763d77ad3da
| * Document that type information is lost when reading QSettings from INIMitch Curtis2019-02-201-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is quite an important detail for an otherwise useful format. We should make the user aware that they currently have a tradeoff: - Either you can store settings in one place on all platforms that your application targets and have to manually manage conversion from strings, or - Use native formats which can be hard to find and edit, but retain type information. Change-Id: Ic648524c9ebff25246d7cdefb7628ff5ddf84964 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | Add missing "override" specifiersAlessandro Portale2019-02-131-3/+3
| | | | | | | | | | | | | | | | Annotate this function with 'override' or (rarely) 'final' [modernize-use-override] Change-Id: If31ab03b46f885e4984ba3aaaf1ad8d46aae9d9c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | Add deprecation exclusion around deprecated calls in deprecated codeFriedemann Kleint2019-02-062-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Fix: io/qdir.cpp:1087:16: warning: ‘static void QResource::addSearchPath(const QString&)’ is deprecated: Use QDir::addSearchPath() instead [-Wdeprecated-declarations] io/qprocess.cpp:1178:34: warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations] image/qpixmap.cpp:997:48: warning: ‘static QPixmap QPixmap::grabWidget(QObject*, const QRect&)’ is deprecated: Use QWidget::grab() instead [-Wdeprecated-declarations] text/qfont.cpp:2218:29: warning: ‘QString QFont::lastResortFamily() const’ is deprecated [-Wdeprecated-declarations] itemviews/qitemdelegate.cpp:1008:41: warning: ‘static QPixmap* QPixmapCache::find(const QString&)’ is deprecated: Use bool find(const QString &, QPixmap *) instead [-Wdeprecated-declarations] Change-Id: I51259edc175b1f55f61ded3af50ebfffd8c304a8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* | QtCore: replace 0 with \nullptr in documentationChristian Ehrlicher2019-01-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | Replace 0 with \nullptr in the documentation. As a drive-by also replace some 0 with nullptr in the corresponding code. Change-Id: I101a61f5fad71cadb73bba9a8fd5dce6cc0836d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-264-26/+90
|\| | | | | | | | | | | | | | | Conflicts: src/android/templates/AndroidManifest.xml tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp Change-Id: I4c9679e3a8ebba118fbf4772301ff8fde60455b9
| * Merge remote-tracking branch 'origin/5.12.1' into 5.12Qt Forward Merge Bot2019-01-233-24/+89
| |\ | | | | | | | | | Change-Id: Icebd151eae0cf9d400319a42573290d1a911ce26
| | * Use a more robust test for absolute paths in QDirEdward Welbourne2019-01-131-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Its filePath() and absoluteFilePath() don't trust its own isAbsolute(), due to some infelicities on MS-Win; and kludged round a consequent problem with resource paths; but other virtual file systems weren't catered for. Replace the convoluted test there with a static bool function (so that future kludges in this area shall only need to edit one place; and can document why they're needed) and use a more robust test that handles all virtual file systems (by asking QFileInfo) but falls back to QFileSystemEntry to work round the known infelicities on MS-Win. Add regression test for asset library paths issue on iOS. Ammends 27f1f84c1c2. Moved a couple of local variables to after the early return, since it doesn't need them, in the process. Task-number: QTBUG-70237 Change-Id: Ib3954826df40ccf816beebe5c3751497e3bf6433 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
| | * Merge remote-tracking branch 'origin/5.12' into 5.12.1Liang Qi2019-01-083-3/+4
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/kernel/qtooltip.cpp Change-Id: Ic2f9a425359050eb56b3a4e5162cf5e3447058c8
| | * | Make url normalization closer to common browser behaviorJoni Poikelin2018-12-133-14/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firefox, Chrome and various http libraries normalize /./ and /../ from urls, but retain multiple adjacent slashes as is. Qt removes duplicated slashes which makes it impossible to access some web resources that rely on those. Fixes: QTBUG-71973 Change-Id: Ie18ae6ad3264acb252fcd87a754726a8c546e5ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | qfilesystemengine_win: Update LinkType whenever askedMårten Nordheim2019-01-221-2/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Checking the known flags prevented us from correctly setting the LinkType flag if we had previously set LinkType as a known flag since the flag is not reset between updates. Manifested itself in situations where the file info is loaded and then the LegacyLinkType flag is checked through QFileInfoPrivate::checkAttribute. Since the LegacyLinkType is not set for Windows it will update the metadata and exclude the LinkType flag. Change-Id: Iea27f42fe11f36ba2247e52fa9c82b4639666a64 Fixes: QTBUG-72644 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QFile/QFileInfo: mark readLink() as deprecatedChristian Ehrlicher2019-01-234-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QFile/QFileInfo::readLink() functions are obsolete but were not marked as deprecated. Explicit mark them as deprecated so they can be removed with Qt6. Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | QProcess: mark obsolete functions as deprecatedChristian Ehrlicher2019-01-232-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QProcess::finished(int)/readChannelMode()/setReadChannelMode() are obsolete but were not marked as deprecated. Explicit mark them as deprecated so they can be removed with Qt6. Change-Id: Iedbfd80a3c987f35caf93181e9277913a18961d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QtCore: mark obsolete functions as deprecatedChristian Ehrlicher2019-01-236-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mark the following obsolete functions as deprecated so they can be removed with Qt6: - QDataStream::unsetDevice() - QDir &QDir::operator=(const QString &path) - QDir::addResourceSearchPath() - QResource::addSearchPath() - QResource::searchPaths() - QSettings::setSystemIniPath() - QSettings::setUserIniPath() Change-Id: I5edfb2b4ce1ad843fa5fcd5b4c475ab9352b05f7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Allow more fine grained control over QFlags debug outputTor Arne Vestbø2019-01-231-4/+54
| | | | | | | | | | | | | | | | | | | | | | | | Useful in contexts such as other QDebug operators, where the class is already known, and the full scope of the flags is not needed. Change-Id: I546381b1722c9c846e2412e56763563b8f625212 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Allow more fine grained control over QMetaEnum debug outputTor Arne Vestbø2019-01-231-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | Useful in contexts such as other QDebug operators, where the class is already known, and the full scope of the enum is not needed. Change-Id: Ibd04b1fd4f0f914c7224a007fc248d4ebabcde3e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add convenience enum for QDebug's verbosity levelsTor Arne Vestbø2019-01-232-5/+19
| | | | | | | | | | | | | | | Change-Id: I9b7ad39c64d4b5787ce59db91b9ddadb82646e31 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add QDebug convenience for changing the verbosity levelTor Arne Vestbø2019-01-232-0/+13
| | | | | | | | | | | | | | | | | | | | | qDebug().nospace().verbosity(3) << myObj; Change-Id: Idea3094294d1afbff302e472e47a55a01d3b7735 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Android: Set minimum supported version to android-21Eskil Abrahamsen Blomfeldt2019-01-231-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the current distribution, this is 90% of active devices, and it was released in 2014. Qt 5.12 is LTS and will continue to support older Android versions for a long time to come. This is to reduce the testing needed on outdated platforms and allow ourselves to use some newer APIs unconditionally in Qt. Android 21 was chosen because it is the minimum version that supports 64 bit builds. [ChangeLog][Android] Increased the minimum supported Android version to Android 5.0 (API level 21). Fixes: QTBUG-70508 Change-Id: Ia7b4345e42ca05a25a292f11ccbb8cbd692cf8f0 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-01-043-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QRawFont::unsupportedWritingSystem() and tst_QGlyphRun::mixedScripts() on windows for now. Conflicts: qmake/generators/makefile.cpp src/corelib/itemmodels/qstringlistmodel.cpp src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp tests/auto/gui/text/qglyphrun/BLACKLIST tests/auto/gui/text/qrawfont/BLACKLIST Task-number: QTBUG-72836 Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
| * | Empty filenames does not existSune Vuorela2018-12-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If empty paths is passed to the unix filesystem engine, we get a warning about empty filename passed to function, before returning false. Fix this by testing for empty string first, and don't send empty string to file engine. The current warning leads to code like if (!filename.isEmpty() && QFile::exists(filename)) { // } rather than the slightly cleaner if (QFile::exists(filename)) { // } Change-Id: I0207324889ec22e5a072c28d58337d117b0153b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * | QRegularExpression: anchor wildcard patternSamuel Gaist2018-12-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current implementation of wildcardToRegularExpression doesn't anchor the pattern which makes it not narrow enough for globbing patterns. This patch fixes that by applying anchoredPattern before returning the wildcard pattern. [ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression method now returns a properly anchored pattern. Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5 Fixes: QTBUG-72539 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Fix warnings building with --std=c++11 and gcc 8Allan Sandfeld Jensen2018-12-141-1/+1
| |/ | | | | | | | | | | | | Silence warnings about signed constants being shifted out of int range. Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Resources: reject compressed content we can't decompressThiago Macieira2018-12-121-3/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solution is composed of two features: 1) C++ code generated by RCC uses two symbols exported from QtCore that are only present if the feature was compiled in. If the feature was not compiled in, this will cause a linker error either at build time or at load time (if they were functions, the error could be at runtime). 2) Binary files generated by RCC have a new header field containing flags. We're currently using two flags, one for Zlib and one for Zstandard. This means we now have binary RCC format version 3. Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Use Q_DISABLE_COPY_MOVE for private classesFriedemann Kleint2018-12-124-5/+5
| | | | | | | | | | Change-Id: I3cfcfba892ff4a0ab4e31f308620b445162bb17b Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* | QResource: quick refactor of registerSelf for files to support LFSThiago Macieira2018-12-111-39/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds sufficient support for large files in resources, but not completely because the rest Qt is not ready for it (and not tested). We've had the QT_MMAP macro in qplatformdefs.h for a while, so let's use it and use qsizetype where we can. This also the check that the file existed before opening it (you can only open it if it exists), plus a few nullptr updates. Change-Id: I42a48bd64ccc41aebf84fffd15653ffdabb0e66b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QResource: de-inline registerSelf for filesThiago Macieira2018-12-111-53/+55
| | | | | | | | | | | | | | | | | | No other changes, aside from the coding style update to make sure the coding style bot won't complain. Change-Id: Iae320a2868db402a993dfffd15689a8a6ac202e8 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | QResource: add support for resources compressed with ZstandardThiago Macieira2018-12-113-18/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See next commit for details on why this is a good idea. [ChangeLog][Important Behavior Changes] The Qt resource system now supports compressing content using the Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses better for the same CPU time, so this algorithm is the default. QResource::isCompressed() returns true for either compression algorithm. Use QResource::compressionAlgorithm() to find out which algorithm to decompress. QFile will automatically decompress using the correct algorithm. Change-Id: I343f2beed55440a7ac0bfffd1562e9a8f94933a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | QUrlQuery: Implement initializer list constructorSamuel Gaist2018-12-092-0/+17
| | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QUrlQuery] QUrlQuery now provides an initializer list constructor. It can be created using a list of key/value pairs. Fixes: QTBUG-68645 Change-Id: Ief5939aa477718f6dd3580f2c60f95ff3aa892ae Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-12-081-3/+6
|\| | | | | | | Change-Id: Ied1194730e75a6f30839bbf5429aa2699230288e
| * QSettings: quick refactor for readabilityThiago Macieira2018-12-071-3/+4
| | | | | | | | | | | | | | | | | | Helps with debugging the code too, as you can follow what's on the file with the "ch" variable. Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b7d76cf657b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| * Fix QSettings parsing of spaces after comment linesThiago Macieira2018-12-071-0/+2
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QSettings] Fixed QSettings parsing of blank spaces after comment lines in INI-style configuration files. Fixes: QTBUG-72007 Change-Id: Idd0c85a4e7b64f9c9c7dfffd156c5b219f3b5c0a Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2018-11-229-39/+43
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdir.cpp src/corelib/kernel/qtimer.cpp src/corelib/kernel/qtimer.h Done-With: Edward Welbourne <edward.welbourne@qt.io> Change-Id: I683d897760ec06593136d77955f8bc87fdef3f9f
| * Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-11-196-26/+19
| |\ | | | | | | | | | | | | | | | | | | Conflicts: src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm Change-Id: I66a08c770767a93cd26535689e3e7806486aab06
| | * Modernize the "settings" featureLiang Qi2018-11-156-26/+19
| | | | | | | | | | | | | | | | | | Change-Id: I9b8a61ecb1413b513ae5c9e77d3ee1b3e8b6562c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
| * | QResourceFileEngine: fix use of mapped files after close()Thiago Macieira2018-11-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | QFile::map() is documented to continue working after the QFile is closed, so this should work for the resource file engine too. Change-Id: I343f2beed55440a7ac0bfffd1563243a3966441f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QResourceFileEngine: fix map() for compressed filesThiago Macieira2018-11-191-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | We were returning a pointer to the compressed data and comparing to the compressed data size. Change-Id: I343f2beed55440a7ac0bfffd1563232d557c9427 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: hjk <hjk@qt.io>
| * | Merge remote-tracking branch 'origin/5.12.0' into 5.12Liang Qi2018-11-162-9/+10
| |\ \ | | | | | | | | | | | | Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
| | * | Doc: Fix various documentation warningsTopi Reinio2018-11-062-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These include typos, marking functions as \internal, documenting trivial things, and fixing the function signatures passed to the \fn command. Task-number: QTBUG-71502 Change-Id: I24a9e1f7e1cdb39e5c31b99202bdd593c6b789ff Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Replace Q_OS_MAC with Q_OS_DARWIN to match line 2731Lars Schmertmann2018-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: Ieefa490d349169db801f3b6d8e3cf799c7621473 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Add QSettings(Scope...) constructor to QSettingsLars Schmertmann2018-11-162-6/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because of the system specific folder/filenames (organization name vs domain) it was not possible to explicitly access the settings with SystemScope without using #ifdef, as it is done by Qt internally. The new constructor uses the default name while creating an instance with a scope. [ChangeLog][QtCore][QSettings] Added QSettings(Scope...) constructor to avoid using #ifdef in Qt applications. Change-Id: I81016430a1d18a382bfdd1e1cf32de367f98d7aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-132-6/+17
|\| | | | | | | | | | | | | | | Change-Id: I5dbdc13c6133e5b03e362c5461b4a599d781bd1e
| * | | Fix ambiguous definition of atime/mtime/ctime on alphaDmitry Shachnev2018-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the implementations is enabled when the stat struct has ::st_atim member, another — when it has ::st_atimensec member. On alpha, the stat struct has both members, defined as union here: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/alpha/bits/stat.h#l48 and then used here: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/unix/sysv/linux/alpha/bits/stat.h#l92 This commit forcefully disables the second implementation on alpha. Change-Id: Ifc284d72b68b9bac590b518f31960288df3a087d Done-with: Michael Cree <mcree@orcon.net.nz> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Fix QFileSystemWatcher::removePath after move operationsFilippo Cucchetto2018-11-121-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Foreword: - During a file or directory move the inotify id for an entity is not changed. - QFileSystemWatcher implementation uses a QMultiHash for mapping an id to its path. Suppose this filesystem hypothetical directory structure - A |--> B and user watches both A and B directories. Suppose that the B directory gets moved by calling "mv B B1". The user receives a directoryChanged event for parent directory A and scan filesystem for changes. During this scan the user notices: - a new directory B1 - a deleted directory B The user simply invoke QFileSystemWatcher::addPath(B1) and QFileSystemWatcher::removePath(B). With the actual implementation the second operation could fail: - The call QFileSystemWatcher::addPath(B1) insert a duplicated records in the QFileSystemWatcher::idToPath multihash ( {0, "A"}, {1, "A/B"} {1, "A/B1"} - The call QFileSystemWatcher::removePath(B) fails because - it first retrieves the the id for path B ---> pathToId("A/B") <-- return 1 - Then it calls idToPath.take with the id obtain in the previous step <--- idToPath.take(1) This last operation could take the record {1, "A/B1"} instead of the {1, "A/B"} (because both have the same key) meaning that the next check "x != path" evaluates to true (making the removePath function fail). This patch fixes the problem in the following way: - Use idToPath.equal_range in order to obtain all paths with the given id - Remove the correct record that match (id, path) - Prevent the removal of the inotify watch if another record with the same id is still present in the multihash (like a simple reference counting). Change-Id: I9c8480b2a869d91e500af5c4aded596b9aa53b46 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | | QFile::copy: include the QTemporaryFile's error message if it failsThiago Macieira2018-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1bd327aeaf73421a8ec5fffd1560a333fdfea909 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>