summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/io
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Regenerate tests with new qt_ prefixed APIsAlexandru Croitor2020-07-0931-49/+49
| | | | | | | | Use pro2cmake with '--api-version 2' to force regenerate projects to use the new prefixed qt_foo APIs. Change-Id: I055c4837860319e93aaa6b09d646dda4fc2a4069 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Regenerate testsAlexandru Croitor2020-07-091-1/+1
| | | | | | | | This is in preparation for regenerating them with the new qt_foo prefixed APIs. Change-Id: Iff34932d642b1c0186ee39f952adf3ad367fd602 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Replace use of deprecated Q_OS_MACX in favor of Q_OS_MACOSTor Arne Vestbø2020-07-081-1/+1
| | | | | Change-Id: I1059d56f67be28a4cc1a66b744e81df6d0b5d00d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add ; to Q_UNUSEDLars Schmertmann2020-07-071-8/+8
| | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Use QList instead of QVector in corelib testsJarek Kobus2020-07-074-5/+5
| | | | | | Task-number: QTBUG-84469 Change-Id: Ic80fde5517aed363f17d0da55cadcc958c3c8895 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Avoid use of Q_UNUSED by eliminating the parameter namesLars Schmertmann2020-07-031-2/+1
| | | | | | | | | This change only happens to files touched by the commit to add missing ; to Q_UNUSED. Task-number: QTBUG-82978 Change-Id: I10e6993a2bb3952cf9a262708b8573550e0dbe63 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix QUrl::toDisplayString(PreferLocalFile) returning an encoded pathDavid Faure2020-06-291-0/+28
| | | | | | | | | | | | | It's supposed to return the same as toLocalFile(), for local files, which means passing QUrl::FullyDecoded just like QUrl::toLocalFile() does. But a few code paths were testing component formatting options without masking other FormattingOptions like RemovePassword, so this had to be fixed. Fixes: QTBUG-84594 Change-Id: I82f15148b6d93516200f9ad6258d474e7f10924a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Skip building tst_qprocess test when cross compilingAlexandru Croitor2020-06-261-1/+6
| | | | | | | | tst_qprocess hangs on the qemu armv7 configuration. Task-number: QTBUG-85287 Change-Id: I5a77a81a24bb1bd315edfcf14f3bcbfd5b925e4d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Remove QByteArray's methods taking QString and their usesSona Kurazyan2020-06-251-2/+0
| | | | | | | | | | [ChangeLog][QtCore][QByteArray] Remove method overloads taking QString as argument, all of which were equivalent to passing the toUtf8() of the string instead. Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move QTextCodec support out of QtCoreKarsten Heimrich2020-06-203-2/+162
| | | | | | | | | | * Assume UTF-8 on all Unix like systems * Export some functions to be able to compile QTextCodec once moved to Qt5Compat. Task-number: QTBUG-75665 Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove winrtOliver Wolff2020-06-0626-197/+90
| | | | | | | | | 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>
* Remove deprecated QProcess methodsVolker Hilsheimer2020-05-271-180/+7
| | | | | | | | | | | | | Add default parameter for arguments in start, startDetached, and execute for better source compatibility with Qt 5.15. This has the risk of then hiding incorrect calls to the previous overload taking a single "command" strings if code is ported from pre-5.15 or ignores deprecation warnings. This is acceptable, given that the alternative is that all calls to these functions would require a default constructed QStringList as the second parameter. Change-Id: I1ba4df97ac4894d007da5083c8359015d784ddbb Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Get rid of some QTextCodec leftoversLars Knoll2020-05-143-3/+0
| | | | | | | There's no real dependency to QTextCodec in those files anymore. Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Get rid of QSettings::iniCodec()Lars Knoll2020-05-141-108/+5
| | | | | | | | | | | | | | | | | | Always encodee INI files as utf-8 in Qt6. This is mostly backwards compatible, as old ini files would encode all non ascii characters. [ChangeLog][Important behavioral changes] QSettings will now always encode INI files as utf-8 (and the iniCodec/setIniCode methods are removed). This is a change from Qt 5 and earlier, where QSettings would by default escape all non ascii characters. The behavior is equivalent to what you got in Qt5 by setting a utf-8 iniCodec on the settings object. Settings files written in Qt 5 will still be readable in Qt 6 (unless an iniCodec different from utf-8 was used), but to read Qt6 based ini files in Qt 5 applications, setting the iniCodec to utf-8 is required. Change-Id: Ic7dffcca17779bd5e3dae50d42ce633170289f6c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port qt_punycodeEncoder() to QStringViewMarc Mutz2020-05-131-1/+1
| | | | | Change-Id: I264e67bc08413f8a39e2d16c774bfd2c76c320ac Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port qt_check_std3rules() to QStringViewMarc Mutz2020-05-131-1/+1
| | | | | | | Also port its callees. These functions scream to the QStringView-ified... Change-Id: I13c95d65941eb8d02223306d80efd1437b4bd9b7 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port qt_urlRecode() to QStringViewMarc Mutz2020-05-121-6/+6
| | | | | | | It's about time :) Change-Id: I27e597516318382850d4c193fd5b66a35fb9c316 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Sweep of int-ish → char-ish types near calls to QString::fromU*()Marc Mutz2020-05-122-82/+82
| | | | | | | | | | | | The fromUtf16(ushort*) and fromUcs4(uint*) overloads are going to be deprecated. Use the newer fromUtf16(char16_t*) and fromUcs4(char32_t*) overloads. As a drive-by, use std::end()/std::size() where applicable. Change-Id: I5a93e38cae4a2e33d49c90d06c5f14f7cb7ce90c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Handle disk full situations by skipping QFile::moveToTrash testVolker Hilsheimer2020-05-071-3/+9
| | | | | | | | | | If any of the temporary directories and files can't be created, skip the test. Otherwise, the cleanup routine would recursively delete "/". Change-Id: I51f908a468be8fd2ebd523ff7ce27a7c78d1b4e2 Fixes: QTBUG-83863 Pick-to: 5.15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QFile::moveToTrash: work with relative file paths on WindowsVolker Hilsheimer2020-05-071-8/+12
| | | | | | | | | | | | | | | | | | | | The system APIs expect an absolute "display name" of the file path, so make it absolute. The test was overly tolerant in accepting failure, as a QStorageInfo initialized with a file path that doesn't exist is invalid, and thus always different from the QStorageInfo of the home directory. Fix the test to compare only valid QStorageInfo objects, and postpone the check until the file we want to move has been created. [ChangeLog][QtCore][QFile] moveToTrash supports relative file paths on Windows Change-Id: I94c8cd40c60fde469e38f76a98f867f20c6a0b15 Fixes: QTBUG-84015 Pick-to: 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* tst_QProcess: create a more reliable crashingThiago Macieira2020-05-051-6/+25
| | | | | | | | | | | | | Turns out that crashing on purpose is more difficult than it seems. It should be easy, given how often we do it accidentally... Let the null pointer dereferencing be the fall back. Some compilers are too smart for their own good and remove the fault. Instead, let's rely on raise(SIGABRT) on Unix and on the UD2 instruction on Windows. Pick-To: 5.15 Change-Id: Ibdc95e9af7bd456a94ecfffd1603f1c9b73b167d Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* tst_QResourceEngine: fix the order of arguments to QCOMPAREThiago Macieira2020-05-051-2/+2
| | | | | | | | Expected and actual were inverted. Pick-To: 5.15 Change-Id: Idc3fae4d0f614c389d27fffd15e9fa6a0a8f25e6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Port more tests from qtbase/tests/auto/corelib/io/ to CMakeSona Kurazyan2020-05-0432-6/+528
| | | | | | Change-Id: I56427e3e1908047a0674c8c80c24eeda80e947c2 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove QTextStream dependency from tst_qfileLars Knoll2020-05-011-15/+6
| | | | | | Change-Id: I83cb05da8c094185b50e9cedea2e705ad1c7f948 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Port test over to use QRegularExpressionLars Knoll2020-04-131-6/+6
| | | | | Change-Id: I7f69fbbdb9e327059cd978b0989eee2c75c5a24b Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-113-4/+12
|\ | | | | | | | | | | | | 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>
| * tst_QSaveFile: skip test that fails when run as rootThiago Macieira2020-04-081-0/+4
| | | | | | | | | | | | | | | | | | | | | | FAIL! : tst_QSaveFile::retryTransactionalWrite() '!file.open(QIODevice::WriteOnly)' returned FALSE. () Loc: [/home/tjmaciei/src/qt/qt5/qtbase/tests/auto/corelib/io/qsavefile/tst_qsavefile.cpp(156)] strace reveals: access("/TEMPDIR/outfile.ro", W_OK) = 0 Change-Id: Ibdc95e9af7bd456a94ecfffd1603eb371aadb02b Reviewed-by: David Faure <david.faure@kdab.com>
| * QTemporaryFile/Linux: don't cut the root dir's slashThiago Macieira2020-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Normally people shouldn't create temporary files on /, but if you're running as root, why not? Caught when running tst_qtemporaryfile as root: openat(AT_FDCWD, "", O_RDWR|O_CLOEXEC|O_TMPFILE, 0600) = -1 ENOENT (No such file or directory) Change-Id: Ibdc95e9af7bd456a94ecfffd1603ebfc17cea220 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-081-2/+54
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/doc/src/cube.qdoc src/corelib/global/qlibraryinfo.cpp src/corelib/text/qbytearray_p.h src/corelib/text/qlocale_data_p.h src/corelib/time/qhijricalendar_data_p.h src/corelib/time/qjalalicalendar_data_p.h src/corelib/time/qromancalendar_data_p.h src/network/ssl/qsslcertificate.h src/widgets/doc/src/graphicsview.qdoc src/widgets/widgets/qcombobox.cpp src/widgets/widgets/qcombobox.h tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro tests/manual/diaglib/debugproxystyle.cpp tests/manual/diaglib/qwidgetdump.cpp tests/manual/diaglib/qwindowdump.cpp tests/manual/diaglib/textdump.cpp util/locale_database/cldr2qlocalexml.py util/locale_database/qlocalexml.py util/locale_database/qlocalexml2cpp.py Resolution of util/locale_database/ are based on: https://codereview.qt-project.org/c/qt/qtbase/+/294250 and src/corelib/{text,time}/*_data_p.h were then regenerated by running those scripts. Updated CMakeLists.txt in each of tests/auto/corelib/serialization/qcborstreamreader/ tests/auto/corelib/serialization/qcborvalue/ tests/auto/gui/kernel/ and generated new ones in each of tests/auto/gui/kernel/qaddpostroutine/ tests/auto/gui/kernel/qhighdpiscaling/ tests/libfuzzer/corelib/text/qregularexpression/optimize/ tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/ tests/libfuzzer/gui/text/qtextdocument/sethtml/ tests/libfuzzer/gui/text/qtextdocument/setmarkdown/ tests/libfuzzer/gui/text/qtextlayout/beginlayout/ by running util/cmake/pro2cmake.py on their changed .pro files. Changed target name in tests/auto/gui/kernel/qaction/qaction.pro tests/auto/gui/kernel/qaction/qactiongroup.pro tests/auto/gui/kernel/qshortcut/qshortcut.pro to ensure unique target names for CMake Changed tst_QComboBox::currentIndex to not test the currentIndexChanged(QString), as that one does not exist in Qt 6 anymore. Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
| * forkfd: fix forkfd_wait when FFD_USE_FORK was activeThiago Macieira2020-03-251-2/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we detected that the OS supports a version of system forkfd (Linux pidfd, FreeBSD procdesc), the forkfd_wait() function was using only the system waiting implementation, which of course can't work for file descriptors created with FFD_USE_FORK. So just detect EBADF and attempt again. If the file descriptor is neither one of our pipes nor a system forkfd, bad things will happen... Fixes: QTBUG-82351 Change-Id: I4e559af2a9a1455ab770fffd15f59fb3160b22eb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | Q{File,FileInfo,Dir}: add std::filesystem::path overloadsMårten Nordheim2020-03-247-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-161-1/+1
| | | | | | | | | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-111-2/+5
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-111-2/+5
| |\| | | | | | | | | | Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
| | * QLoggingRegistry: use QStringView/QLatin1String moreMarc Mutz2020-03-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - QLoggingRule::parse() and the ctor take pattern as QStringView - parseNextLine takes lines as QStringView and produces the pattern as QStringView for QLoggingRule - (setContent has to wait for QStringTokenizer) - QLoggingRule::pass()'s first argument is always QLatin1String, so take it as one Use chopped() more, add a std::move(). Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QtConcurrent::run: accept more then five function's argumentsVitaly Fanaskov2020-03-112-8/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] QtConcurrent::run has the following signatures: run(Function &&f, Args &&...args) and run(QThreadPool *pool, Function &&f, Args &&...args). If f is a member pointer, the first argument of args should be an object for which that member is defined (or a reference, or a pointer to it). See the documentation for more details. Fixes: QTBUG-82383 Change-Id: I18f7fcfb2adbdd9f75b29c346bd3516304e32d31 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-033-5/+5
|\| | | | | | | Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
| * Core: Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-02-283-5/+5
| | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step closer to that goal. Change-Id: I446f9ddc8f8de4a0b79b09edb44f7c1496fbc33f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | QDebug::toString(): use nospace()Mitch Curtis2020-02-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The intended use cases for toString() are the situations where you can't use operator<<, such as QVERIFY2, Q_ASSERT_X, etc., which means that it will often be used as an argument to e.g. QString::arg(), where the user has control over the structure of the message. For that reason, adding an extra space to the end is not necessary and just gets in the way. This amends 658b9697f9d85d4ed294810b4f60bafdbdd8e247. Change-Id: I0695e6809026a0f92ed783899da80de4fa2a1684 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devLars Knoll2020-02-281-2/+3
|\| | | | | | | Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-261-2/+3
| |\ | | | | | | | | | Change-Id: Iad459349ea8b4090d79b4771bfff8f656a8a8189
| | * tst_QSettings: Fix leaking registry keyFriedemann Kleint2020-02-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Windows, the test was leaking a registry key HKEY_CURRENT_USER\Software\tst_QSettings_trailingWhitespace Fix by using .ini-Format in the temporary directory created by the test. Amends e66a878838f17a0626b0b10b340b1ca4dba56cc1. Task-number: QTBUG-22461 Change-Id: If141a9e72e8faebc3fc46b94dab7b4b728a75292 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add QDebug::toString()Mitch Curtis2020-02-221-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This template function streams the given object into a QDebug instance that operates on a string, and then returns that string. This function is useful for cases where you need the textual representation of an object for debugging, but cannot use operator<<. A good example of this is when writing tests where you want to provide a useful failure message involving details about an object, but must provide it in a string to e.g. QVERIFY2. [ChangeLog][QtCore][QDebug] Added static template toString() function, which streams the given object into a QDebug instance that operates on a string, and then returns that string. Fixes: QTBUG-82309 Change-Id: I8411394e899dedad19cec788d779a4515d52ba11 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Remove QUrl::topLevelDomainTimur Pocheptsov2020-02-202-58/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And move the actual implementation from corelib/io to network/kernel sub-module. Fixes: QTBUG-80308 Change-Id: I554b05bae3552c68e1e1a405c169366ee19120b2 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | | Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-02-1316-17/+16
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/manual/rhi/hellominimalcrossgfxtriangle/CMakeLists.txt Hopefully final merge from wip/cmake, and then all cmake changes should target dev directly. Change-Id: I29b04c9b0284e97334877c77a32ffdf887dbf95b
| * | | Regenerate projects one last time before mergewip/cmakeAlexandru Croitor2020-02-1216-17/+16
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Merge remote-tracking branch 'origin/5.15' into devLiang Qi2020-02-131-0/+140
|\ \ \ \ | |/ / / |/| / / | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/widgets/graphicsview/boxes/scene.h src/corelib/Qt5CoreMacros.cmake src/corelib/Qt6CoreMacros.cmake src/network/ssl/qsslsocket.cpp src/network/ssl/qsslsocket.h src/platformsupport/fontdatabases/windows/qwindowsfontenginedirectwrite.cpp src/testlib/CMakeLists.txt src/testlib/.prev_CMakeLists.txt tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp Disabled building manual tests with CMake for now, because qmake doesn't do it, and it confuses people. Done-With: Alexandru Croitor <alexandru.croitor@qt.io> Done-With: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I865ae347bd01f4e59f16d007b66d175a52f1f152
| * | On Windows 7, fall back to SHFileOperation to avoid confirmation dialogsVolker Hilsheimer2020-02-071-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moving a file to the trash should preferably done via IFileOperation. However, the implementation on Windows 7 ignores the operation flags that request the shell not to show any confirmation dialogs or other UI elements. SHFileOperation is an old API that doesn't show any UI, but has the limitation that it doesn't report the location of the file in the trash after the move. So an application cannot restore the file, but the user can do so via Explorer. Overall, the better compromise is to not have dialogs at the expense of not being able to report the new path. This allows us to run the unit test on Windows 7 as well. Change-Id: Ib8e651a69e2c6750f668b52d2a70925d156cc8ae Fixes: QTBUG-81927 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
| * | Add QFile::moveToTrash, which moves a file to the trashVolker Hilsheimer2020-02-051-0/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the nature of QFile just operating on a file path, this also works for paths that are actually directories. The test covers files from different locations on which this operation should typically succeed, but tries to handle the case where trashing files will fail because of the file system structure. On Windows 7, running the test will open a confirmation dialog as the implementation of IFileOperation doesn't respect the various flags. This might depend on the specific Windows 7 patch level, and the option to always use SHFileOperation on that platform needs to be evaluated further. [ChangeLog][QtCore][QFile] Introduce QFile::moveToTrash to allow applications to move files to the trash. Change-Id: I45019040c25b30f7db293b6933c63aca2f319514 Fixes: QTBUG-47703 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>