summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Tests: check the output of QFile::openGiuseppe D'Angelo2024-03-271-7/+7
| | | | | | | | | | Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileInfo: Use new comparison helper macrosRym Bouabid2024-02-141-1/+8
| | | | | | | | | | | | QFileInfo had operator==() and operator!=() defined as public member functions, so use QT_CORE_REMOVED_SINCE and removed_api.cpp to get rid of these methods and replace them with a hidden friend. Use QT_TEST_ALL_EQUALITY_OPS macro in unit-tests. Task-number: QTBUG-120303 Change-Id: Ie290df230b0f608a0965dccba9184382291cad8e Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* tst_QFileInfo: don't trigger libstdc++ std::filesystem bugThiago Macieira2023-09-011-0/+3
| | | | | | | | | | | | libstdc++'s std::filesystem::path implementation incorrectly assumes that any 8-bit char input is UTF-8, when it patently isn't on Windows. Reported at https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111244 Pick-to: 6.5 6.6 Fixes: QTBUG-116609 Change-Id: I2b24e1d3cad44897906efffd17803f2862935c9b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QFileInfo: replace a portion of a macro with a lambdaThiago Macieira2023-09-011-6/+8
| | | | | | | | | It's very hard to debug a macro. Pick-to: 6.5 6.6 Change-Id: I2b24e1d3cad44897906efffd17803b8eac9bd844 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QFileInfo::stdfilesystem: add extra Unicode string testsThiago Macieira2023-09-011-0/+12
| | | | | | | Pick-to: 6.6 Change-Id: I2b24e1d3cad44897906efffd17803f70bd4d60f6 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tests/auto/*: port Q_FOREACH to ranged-forAhmad Samir2023-08-191-4/+2
| | | | | | | | | | | | | The loop was iterating over a temporary container, so it couldn't have changed it. Store the container in a const auto variable and use ranged-for. In files where Q_FOREACH isn't used any more, remove "#undef QT_NO_FOREACH". Task-number: QTBUG-115839 Change-Id: I402df5fa48f4287f3cc989ddae1524da43999049 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Mark all of Qt as free of Q_FOREACH, except where it isn'tMarc Mutz2023-08-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | The density of Q_FOREACH uses in this and some other modules is still extremely high, too high for anyone to tackle in a short amount of time. Even if they're not concentrated in just a few TUs, we need to make progress on a global QT_NO_FOREACH default, so grab the nettle and stick to our strategy: Mark the whole of Qt with QT_NO_FOREACH, to prevent new uses from creeping in, and whitelist the affected TUs by #undef'ing QT_NO_FOREACH locally, at the top of each file. For TUs that are part of a larger executable, this requires these files to be compiled separately, so add them to NO_PCH_SOURCES (which implies NO_UNITY_BUILD_SOURCES, too). In tst_qglobal.cpp and tst_qcollections.cpp change the comment on the #undef QT_NO_FOREACH to indicate that these actually test the macro. Task-number: QTBUG-115839 Change-Id: Iecc444eb7d43d7e4d037f6e155abe0e14a00a5d6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Corelib: s/Q_OS_MAC/Q_OS_DARWIN/wg except for doc and definitionEdward Welbourne2023-03-201-9/+9
| | | | | | | | | | I got tired of being told off by the inanity 'bot for faithfully reflecting existing #if-ery in new #if-ery. Retain only the documentation and definition of the deprecated define. Change-Id: I47f47b76bd239a360f27ae5afe593dfad8746538 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Avoid potential data races caused by qt_ntfs_permission_lookupMate Barany2023-02-081-10/+2
| | | | | | | | | | | | | | | | | qt_ntfs_permission_lookup is a global, non-atomic variable which could cause problems in case of multiple threads. Introduce a new atomic variable to handle permission lookups but instead of manual incrementation/decrementation, implement a class to manage the variable. Since the atomic variable is not directly available to the user, implement helper functions to increase/decrease/check the status of the variable. Task-number: QTBUG-105804 Change-Id: If6cbcdd653c7f50ad9853a5c309e24fdeb520788 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QFileInfo: use currentDateTimeUtc()Ahmad Samir2023-01-061-4/+4
| | | | | | | | Instead of the more verbose currentDateTime(QTZ::UTC). Pick-to: 6.5 Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use QFileInfo's file times in UTC for file timestampsAhmad Samir2023-01-041-21/+21
| | | | | | | | | | | This is inherently faster than getting it in UTC from the underlying native API stat call, then converting it to the Local Time Zone just to compare them. The same goes for any use-case where you get a QDateTime then the first thing you do is call t.to{Msec,Secs}SinceEpoch(). Change-Id: Ic13bcfd99b937c9f10f102ea7741832950a553c6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Add QFileInfo::readSymLink() to read the raw link pathWang Fei2022-12-231-0/+16
| | | | | | | | | | | | | The existing symLinkTarget() always resolves the symlink target to an absolute path; readSymLink() provides access to the relative path when that is how the symlink references its target. [ChangeLog][QtCore][QFileInfo] Added readSymLink() to read the symlink's raw target, without resolving to an absolute path. Fixes: QTBUG-96761 Change-Id: I360e55f1a3bdb00e2966229ea8de78cf29a29417 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileInfo: add unittest for setFileTime()Ahmad Samir2022-11-011-0/+16
| | | | | | | Borrowed from tst_qtemporaryfile with some changes. Change-Id: I596ddd0ac8dbe10edd63e481198064dcec15d3e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove network dependency for tests with UNC pathsVolker Hilsheimer2022-08-171-7/+4
| | | | | | | | | | | | | | | | | | | Windows VMs are provisioned with shared folders that are available as \\${COMPUTERNAME}\testshare(writable) so we don't need to access a remote SMB server over network anymore just to test whether our string-parsing code handles UNC paths correctly. Add a QTest::uncServerName() helper function to the shared filesystem.h header and use that instead of QtNetworkSettings::winServerName. The latter is now only used in tst_NetworkSelfTest::smbServer(). Pick-to: 6.4 Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-27/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Replace uses of _qs with _s in testsSona Kurazyan2022-04-071-2/+4
| | | | | | Task-number: QTBUG-101408 Change-Id: If092a68828a1e8056259cf90d035d9a87989244b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add QFileInfo::isAlias() to reflect whether the file is a macOS aliasTor Arne Vestbø2022-03-061-0/+58
| | | | | | Change-Id: I772066d0d8e69893f7c4aee1cd2305d46d5834c4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Repair tst_qfileinfo on AndroidAndreas Buhr2022-02-161-1/+8
| | | | | | | Pick-to: 6.2 6.3 Change-Id: I79e0236b90b8a6ca2618d7a9ddac34b26bbd5b5f Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QNX: Successful check depends on user running testPasi Petäjäjärvi2021-12-121-1/+1
| | | | | | | | Modify similar like is used for Windows Pick-to: 6.2 Change-Id: I133a8dde2e78cc66aa9544246cd750a6543b4883 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Compile private Qt APIs autotests for INTEGRITYTatiana Borisova2021-10-051-2/+2
| | | | | | | | | | - getgrgid/getpwuid are not supported - the default constructor of "ObserverOrUninit" must be referenced for GHS compiler Task-number: QTBUG-96176 Pick-to: 6.2 Change-Id: I24093da76e116aba4b87a8f5c5763b03d082a2cd Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove conditioning on Android embeddedEdward Welbourne2021-09-171-3/+3
| | | | | | | | It is no longer handled separately from Android. This effectively reverts commit 6d50f746fe05a7008b63818e77784dd0c99270a1 Change-Id: Ic2d75b8c5a09895810913311ab2fe3355d4d2983 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* testlib: Deprecate QWARN() in favor of qWarning()Tor Arne Vestbø2021-08-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The QtTest best practices documentations recommends using output mechanisms such as qDebug() and qWarning() for diagnostic messages, and this is also what most of our own tests do. The QWARN() macro and corresponding internal QTest::qWarn() function was added when QtTest was first implemented, but was likely meant as an internal implementation detail, like its cousin QTestLog::info(), which does not have any corresponding macro. This theory is backed by our own QtTest self-test (tst_silent) describing the output from QWARN() as "an internal testlib warning". The only difference between QWARN() and qWarning(), besides the much richer feature set of the latter, is that qWarning() will not pass on file and line number information in release mode, but QWARN() will. This is an acceptable loss of functionality, considering that the user can override this behavior by defining QT_MESSAGELOGCONTEXT. [ChangeLog][QtTest] QWARN() has been deprecated in favor of qWarning() Pick-to: 6.2 Change-Id: I5a2431ce48c47392244560dd520953b9fc735c85 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Implement QFileInfo::junctionTarget(), adjust auto-testKarsten Heimrich2021-06-051-3/+25
| | | | | | | | | | | | The change in 004e3e0dc2cab4a4534d2ed3ace41aad6bfbe45d introduces Windows junction awareness, though users were still unable to resolve the junction target. This change adds the ability to solve this. Fixes: QTBUG-93869 Change-Id: I9f4d4ed87b92e757f7b6d8739e2a61b58c096f63 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Make bool isSymLink, isJunction inferred from resource.typeKarsten Heimrich2021-06-021-14/+16
| | | | | Change-Id: I90574b62c8d21e3559fb219543f564454b4335e1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor createSymbolicLink() and createNtfsJunction()Karsten Heimrich2021-06-021-29/+24
| | | | | | | | Both functions now return a result object. Eliminates the need to pass the errorMessage out-parameter. Adapt auto-tests. Change-Id: I110b68fedc67b01f76796c44fa55383b2cc03460 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move createSymbolicLink() to the shared headerKarsten Heimrich2021-06-021-30/+5
| | | | | Change-Id: I737f521791faf07d704e15d36d57444b3187ba9d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+4
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QFileInfo: purge deprecated APIEdward Welbourne2020-08-071-7/+1
| | | | | | | | Since 5.10: created() Since 5.13: readLink() Change-Id: I9722f81750dd92315a67a1c38df41a95ae63e0db Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove winrtOliver Wolff2020-06-061-41/+22
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-111-4/+5
|\ | | | | | | | | | | | | Conflicts: tests/auto/network/socket/platformsocketengine/platformsocketengine.pri Change-Id: I22daf269a8f28f80630b5f521b91637531156404
| * tst_QFileInfo: fix running with systems without /etc/passwdThiago Macieira2020-04-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Clear Linux containers running as root may have no /etc/passwd. But they'll have /etc/machine-id because systemd creates that. Also test /proc/version (a Linux-specific file) because that isn't writeable even by root. Take the opportunity to check with access() instead of assuming root and only root can write to the file. Change-Id: Ibdc95e9af7bd456a94ecfffd1603e8359604752b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Q{File,FileInfo,Dir}: add std::filesystem::path overloadsMårten Nordheim2020-03-241-0/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some overloads where (I thought) it makes sense for QDir and QFile to accept std::filesystem::path objects. Currently my thinking is to not add overloads for static functions where std::filesystem can already do the same job, e.g. create directory or file. Template and enable_if is needed due to both QString and std::filesystem::path being able to be constructed from string literals. The common shared code is currently in QFile because QDir had an implicit include of QFile, made explicit in this patch, and QFileInfo has an include to QFile as well. The QT_HAS_STD_FILESYSTEM macro is visible in user-code which I currently take advantage of in the tests, and users could too. Change-Id: I8d05d3c34c6c17e20972a6a2053862b8891d6c3c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-11-251-11/+14
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qhash.h src/gui/kernel/qevent.h src/widgets/kernel/qshortcut.cpp src/widgets/kernel/qshortcut.h Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
| * Make Qt aware of NTFS Junctions on WindowsRyan Chu2019-11-091-11/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On NTFS, a junction point can be created and deleted by the mklink and rmdir commands, respectively. If a directory is not identified correctly as a junction, then applications will likely try to remove it using recursive methods, leading to fatal data loss. With this change, Qt can identify file system entries as junctions, allowing applications to use the correct file system operation to remove it. The test needs to delay the cleaning up of junctions and files it creates until the checks are complete; since they might fail and make the test function return prematurely, use a scope guard. [ChangeLog][QtCore][QFileInfo] Add QFileInfo::isJunction so that applications can recognize NTFS file system entries as junctions Task-number: QTBUG-75869 Change-Id: I3c208245afbd9fb7555515fb776ff63b133ca858 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2019-10-171-11/+7
|\| | | | | | | Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
| * Win32: Consolidate registry codeFriedemann Kleint2019-10-141-11/+7
| | | | | | | | | | | | | | | | Add a RAII class for registry keys and use it throughout the code base. Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/wip/qt6' into devSimon Hausmann2019-09-181-1/+1
|\ \ | |/ |/| | | | | | | | | Conflicts: src/gui/image/qpicture.cpp Change-Id: Iecf79f96f54dc23bd703e6c4c634f909b796d7b3
| * Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-09-041-4/+187
| |\ | | | | | | | | | Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
| * \ Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-07-081-2/+7
| |\ \ | | | | | | | | | | | | Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f
| * \ \ Merge remote-tracking branch 'origin/dev' into wip/qt6Alexandru Croitor2019-06-061-0/+2
| |\ \ \ | | | | | | | | | | | | | | | Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
| * | | | Bump version to Qt 6Lars Knoll2019-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this triggers asserts. QMetaType also has some Qt 6 specific code disabled to get things to compile. Fix various details in autotests to accommodate for the changes with Qt 6. Add a workaround for black lists on macos, where QSysInfo::productType() now returns 'macos' and not 'osx' anymore. Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | | Remove QOperatingSystemVersion::WindowsVistaSona Kurazyan2019-09-051-2/+1
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The minimum supported version is Windows 7. Remove QOperatingSystemVersion::WindowsVista added by b0cd007335853f283c47ffb0f5611d14e6dbe84b and replace with "true" wherever it was used. Change-Id: I08c0208467b655a921b6773f77d8bc099be69031 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Remove QFileInfo::type and related enum from 5.14Volker Hilsheimer2019-08-301-82/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The API is problematic for several reasons: - the mixing of flags and enum in a single enum type - the name "type" as somewhat overloaded - the ease of misuse when comparing the result rather than testing for a bit being set In light of this, focus for 5.14 on the new isShortcut and isSymbolicLink functions, thus migitating the problematic isSymLink which conflates the two concepts. Change-Id: I57e02321edd5061f69a775f04a0932ef89adf866 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | Make Qt aware of symlinks and shortcuts on WindowsRyan Chu2019-08-161-4/+162
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt has traditionally considered Windows shortcut files equivalent to symlinks on Unix file systems. Because of NTFS symlinks, the interpretation of shotcut files as symlinks is confusing. In this change, QFileInfo treats shortcut (.lnk) files as regular files but can follow the pointed object. In addition, QFileInfo introduces a more comprehensive file type. So that applications can make well-informed decisions about how to treat a file system entry. Based on the implementation of QFileInfo::type(), two inline helper functions are introduced to QFileInfo. 1. isSymbolicLink, returns true if it points to a symbolic link. 2. isShortcut, returns true if it points to a shortcut. [ChangeLog][QtCore][QFileInfo] Introduce QFileInfo::type() to replace the isSymLink method. Task-number: QTBUG-75869 Change-Id: Icc0dd52f9ad0ea50b0265d77ee0d0a3d25054e39 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Remove usages of QSysInfo's deprecated APIsSona Kurazyan2019-07-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced QOperatingSystemVersion::WindowsVersion, QSysInfo::windowsVersion(), QSysInfo::macVersion(), QSysInfo::MacintoshVersion with QOperatingSystemVersion::current(). - Added QOperatingSystemVersion::WindowsVista for convenience, as it is used in lots of places. Change-Id: If9c4ac496005b2e70b5c70be160747afa74b98c1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* | | Remove usages of deprecated APIs of corelibSona Kurazyan2019-07-051-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of deprecated APIs of corelib by corresponding alternatives in the library code and documentation. - Modified the tests to make them build when deprecated APIs disabled: * Made the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Task-number: QTBUG-76491 Task-number: QTBUG-76539 Task-number: QTBUG-76541 Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Remove usages of deprecated APIs from QDateTimeSona Kurazyan2019-07-021-1/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replaced the usages of: * QDateTime::toTime_t() -> QDateTime::toSecsSinceEpoch(). * QDateTime::fromTime_t() -> QDateTime::fromSecsSinceEpoch(). * QDate::shortDayName() -> QLocale::system().dayName(). * QTime by QElapsedTimer, where the deprecated methods of QTime were used. - Modified the tests for the deprecated methods to be enabled only when the corresponding methods are enabled: when the deprecated APIs are disabled, the tests will be also disabled, and the compilation won't be broken. Task-number: QTBUG-76491 Change-Id: I4d565db2329e580c567aae511696eb1efe120843 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devFriedemann Kleint2019-05-271-0/+2
|\ \ | |/ |/| | | Change-Id: Ia279fc4a8226626041c772902a07b2f90f37b53b
| * Fix canonicalFilePath() for files with trailing slashesVolker Hilsheimer2019-05-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Such files do not exist (as per QFileInfo::exists), but on some platforms that rely on realpath(), QFileInfo::canonicalFilePath did not return the empty string. Use the same logic on macOS as we already did on Android, and include a test case. Remove the unnecessary dynamic memory allocation and use a stack-allocated array instead, unless we use modern POSIX in which case realpath() will alloc the memory for the result for us. Change-Id: Ide987c68ebf00cbb7b1a66c2e9245a12c7807128 Fixes: QTBUG-44242 Reviewed-by: Lars Knoll <lars.knoll@qt.io>