diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2023-09-20 22:35:56 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-09-24 14:10:56 -0700 |
commit | 6ca2008d6e1e02e85f39faab28d5c8a0c0dad082 (patch) | |
tree | bbfe13f790e4a36004a3ad5987f1e2032a086eaf /src/corelib/kernel/qobject_p.h | |
parent | 36a169e31e86fadde41c61804ce437164977f60a (diff) |
If a move-to-trash operation failed, e.g. because the file was opened by
another process (or QFile), then the moveToTrash function would still
return true.
MSDN documents the IFileOperation::PerformOperations to return whether
the operation succeeded, but evidently this is only a statement about
the execution of queued up operations, not a statement about any of the
operations' success.
If the operation succeeded is reported by an HRESULT parameter
of the IFileOperationProgressSink::PostDeleteItem implementation,
and we ignored that parameter so far.
Check it via the SUCCEEDED macro, and set a boolean sink variable based
on that, which we can inspect to return the correct value.
Augment the test case by opening those files we create ourselves, and
if that fails (which it will on Windows, but not necessarily on other
platforms), then try again after closing the file. If the first attempt
succeeded, then the source file must also be gone.
Pick-to: 6.6 6.5 6.2 5.15
Fixes: QTBUG-117383
Done-With: Thiago Macieira <thiago.macieira@intel.com>
Change-Id: Icb82a0c9d3b337585dded622d6656e07dee33d84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/corelib/kernel/qobject_p.h')
0 files changed, 0 insertions, 0 deletions