From e79979ba40992d5ae8e12084f91c0d06f158a4df Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Thu, 6 Feb 2020 10:17:52 +0100 Subject: On Windows 7, fall back to SHFileOperation to avoid confirmation dialogs 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 --- tests/auto/corelib/io/qfile/tst_qfile.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qfile/tst_qfile.cpp b/tests/auto/corelib/io/qfile/tst_qfile.cpp index b065e1f10f..350bff0652 100644 --- a/tests/auto/corelib/io/qfile/tst_qfile.cpp +++ b/tests/auto/corelib/io/qfile/tst_qfile.cpp @@ -3681,9 +3681,6 @@ void tst_QFile::moveToTrash_data() QTest::addColumn("create"); QTest::addColumn("result"); - if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) - QSKIP("Windows 7 insists on showing a confirmation dialog", SkipAll); - // success cases { QTemporaryFile temp; -- cgit v1.2.3