qt6-bb10/tests/auto/gui
Volker Hilsheimer 351b5b3e94 QFileSystemModel on Windows: consistently trim spaces and dots
On Windows, file- and directory-names that end with a space (or a dot)
are invalid, even though it's possible to create them. Same for names
that start with a space (but starting with dots is ok). Even Explorer
chokes when trying to then delete or rename such a file or directory,
and often the only way out of the mess is to operate on the 8.3 path.

In Qt, we only sometimes fixed such paths by removing trailing spaces
and dots. This still made it possible to create a "bad " directory in a
non-native file dialog, which could then not be deleted. The node tree
even ended up with both "bad " and "bad", neither of which was handled
correctly.

Fix this by always chopping trailing space and dots when adding or
modifying a node, amending 3693d3d2a1e76f6e6d41db340505e00c6ddaeda1.

Fortunately, this can be reproduced with QFileSystemModel, so add a test
that exercises it in the same way as QFileDialog does, e.g. both by
creating the misnamed directory directly, and by renaming a directory to
an invalid name.

Given that this is very broken on Windows Explorer as well, don't
cherry-pick this back into branches under strict change management.

Fixes: QTBUG-129028
Change-Id: Iec1edf9fd2548dda4567134a9b5cf3e298589c19
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 53df22b42d73dbb48bc25ad05500993df56b928c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-29 17:42:12 +00:00
..
image Add autotest for QImageIO format handler plugins 2024-10-26 00:04:44 +00:00
itemmodels QFileSystemModel on Windows: consistently trim spaces and dots 2024-10-29 17:42:12 +00:00
kernel tests: blacklist tst_QWindow::windowExposedAfterReparent() on u24.04 x11 2024-09-20 00:42:58 +00:00
math3d tst_qmatrixnxn: Mark variable as unused to avoid compiler warning 2024-05-29 20:27:18 +02:00
painting Fix text drawing onto transparent ARGB32 2024-10-10 15:18:36 +00:00
platform tests: skip most functions in tst_qx11info on offscreen 2024-06-14 11:02:50 +00:00
qopengl Change license for tests files 2024-02-04 09:56:42 +01:00
qopenglconfig Change license for tests files 2024-02-04 09:56:42 +01:00
qvulkan Vulkan test: replace QVERIFY with appropriate QCOMPARE 2024-09-23 19:36:54 +00:00
rhi Revert "Skip Vulkan on Android in QRhi autotest" 2024-04-05 20:31:07 +00:00
text Respect QTextDocument::defaultFont() in ODF writer 2024-08-19 19:42:55 +00:00
util QDesktopServices: clean up pre-Qt-6.6 code 2024-05-15 18:22:39 +02:00
CMakeLists.txt