Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
6.7
-
None
-
ubuntu 22
-
-
3302b0cdc (dev), 591a9512a (6.8), 3a01c97d0 (6.7)
Description
My bash steps
mkdir ~/myFolder ln -s ~/myFolder ~/mySymlink cd ~/mySymlink touch 1 2 3
My Qt code
qDebug() << QFile::moveToTrash("/home/user/mySymlink/"); true
And I open Trash and see mySymlink, looks good but /home/user/mySymlink/ also alive! So moveToTrash doesn't do move to trash action, it do copy to trash action. To make move to trash action I should do Qt code without symbol / at the and
qDebug() << QFile::moveToTrash("/home/user/mySymlink"); true
Yes, in this case the mySymlink is really removed. It looks like not a bug but feature. If you think that this is feature then I suggest to describe this behavior in docs.
P.S. For folder it is no matter does you use / at the end or not so QFile::moveToTrash("/home/user/myFolder/") is the same as QFile::moveToTrash("/home/user/myFolder");
P.P.S. But if you use QFile::moveToTrash("/home/user/myFolder/../Folder2") then I expect big problem...
Attachments
Issue Links
- depends on
-
QTBUG-123113 introduce QDir::moveToTrash
- Open