qt5base-lts/tests/auto/corelib
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
..
animation Flatten version-specific blacklisting on macOS to all macOS versions 2020-01-22 17:58:31 +01:00
codecs Port from QStringViewLiteral to u"" 2019-07-29 11:17:28 +03:00
global Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-09 20:30:39 +01:00
io Implement moving of a single file system entry to the trash 2020-01-30 06:14:56 +01:00
itemmodels QIdentityProxyModel: implement moveRows / moveColumns 2020-01-02 17:48:07 +01:00
kernel Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-29 01:00:56 +01:00
mimetypes Remove handling of missing Q_COMPILER_RVALUE_REFS 2019-05-01 20:24:45 +00:00
plugin Avoid initializing QFlags with 0 or nullptr in tests 2019-11-26 09:08:51 +01:00
serialization Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-28 16:02:04 +01:00
statemachine QStateMachine: Don't scream at the user 2019-10-24 10:26:03 +02:00
text Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-13 01:00:45 +01:00
thread Flatten version-specific blacklisting on macOS to all macOS versions 2020-01-22 17:58:31 +01:00
time Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-15 01:00:39 +01:00
tools Merge remote-tracking branch 'origin/5.14' into 5.15 2020-01-28 08:09:51 +01:00
corelib.pro Move text-related code out of corelib/tools/ to corelib/text/ 2019-07-10 17:05:30 +02:00