qt5base-lts/tests/auto/corelib/io
Volker Hilsheimer 601ce9e08a Implement moving of a single file system entry to the trash
This implements the operation for Windows, macOS, and Unix, for now
only as a private API (since QFileSystemEngine is private). This adds
the capability as a testable function; public API to be agreed on and
added in a separate commit.

The Unix implementation follows the freedesktop.org specification [1]
version 1.0.

[1] https://specifications.freedesktop.org/trash-spec/trashspec-1.0.html

On macOS and Windows, native APIs are used, with each having some
limitations:

* on macOS, the file in the trash won't have a "put back" option,
  as we don't use Finder automation, for the reasons provided in the
  comments
* on Windows, we might not be able to use the modern IFileOperation
  API, e.g. if Qt is built with mingw which doesn't seem to provide
  the interface definition; the fallback doesn't provide access to
  the file name in the trash

The test case creates files and directories, and moves them to the
trash. As part of the cleanup routine, it deletes all file system
entries created. If run on Windows without IFileOperations support,
this will add a file in the trash for each test run, filling up
hard drive space.

Task-number: QTBUG-47703
Change-Id: I5f5f4e578be2f45d7da84f70a03acbe1a12a1231
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
2020-01-30 06:14:56 +01:00
..
largefile Remove usages of deprecated APIs from QtAlgorithms 2019-06-29 21:58:36 +02:00
qabstractfileengine
qbuffer
qdataurl
qdebug Port from QStringViewLiteral to u"" 2019-07-29 11:17:28 +03:00
qdir Avoid initializing QFlags with 0 or nullptr in tests 2019-11-26 09:08:51 +01:00
qdiriterator Avoid initializing QFlags with 0 or nullptr in tests 2019-11-26 09:08:51 +01:00
qfile Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
qfileinfo Make Qt aware of NTFS Junctions on Windows 2019-11-09 00:47:45 +01:00
qfileselector Do not strip off the fragment and query in the qfileselector 2019-06-03 12:29:49 +00:00
qfilesystemengine Implement moving of a single file system entry to the trash 2020-01-30 06:14:56 +01:00
qfilesystementry
qfilesystemmetadata
qfilesystemwatcher QFileSystemWatcher/win: watch also for attribute changes of directories 2020-01-10 06:24:14 +01:00
qiodevice
qipaddress
qlockfile Avoid initializing QFlags with 0 or nullptr in tests 2019-11-26 09:08:51 +01:00
qloggingcategory Prefix QTextStream operators with Qt:: in tests 2019-05-03 09:36:36 +00:00
qloggingregistry
qnodebug Fix encoding inconsistency between tst_QNoDebug and QTestLog 2020-01-09 10:57:49 +01:00
qprocess Update for failures only on dev branch. Use general platform names 2019-08-19 18:22:11 +02:00
qprocess-noapplication
qprocessenvironment
qresourceengine QResource: Add API to get the decompressed content 2020-01-15 12:36:59 -08:00
qsavefile Avoid initializing QFlags with 0 or nullptr in tests 2019-11-26 09:08:51 +01:00
qsettings Win32: Consolidate registry code 2019-10-14 20:26:42 +02:00
qstandardpaths Merge remote-tracking branch 'origin/5.13' into 5.14 2019-10-24 10:23:44 +02:00
qstorageinfo Ignore failing test for free space on APFS 2019-04-30 10:58:13 +00:00
qtemporarydir
qtemporaryfile Merge remote-tracking branch 'origin/5.13' into dev 2019-06-27 14:38:03 +02:00
qurl Fix mis-handling of actual TLD in qIsEffectiveTLD() 2019-09-16 17:05:09 +02:00
qurlinternal Deprecate constructing QFlags from a pointer 2019-11-20 19:43:38 +01:00
qurlquery QUrlQuery: Implement initializer list constructor 2018-12-09 11:35:27 +00:00
io.pro