https://bugs.kde.org/show_bug.cgi?id=521088

            Bug ID: 521088
           Summary: KDE tries to create trash in / directory
    Classification: Frameworks and Libraries
           Product: frameworks-kio
      Version First 6.26.0
       Reported In:
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Trash
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

Created attachment 192906
  --> https://bugs.kde.org/attachment.cgi?id=192906&action=edit
A small program to reproduce the issue.

DESCRIPTION:
Whenever I move a file to the Trash, eg in Gwenview, I see the following
message in the terminal:
kf.kio.workers.trash: Creating trash for "/" failed - no permission?

A contributing factor is most likely that my home directory is on a different
mount point than /.

STEPS TO REPRODUCE
1.  I start a program like gwenview
2.  I select a picture
3.  I press the DEL key to delete the file

OBSERVED RESULT
The text `kf.kio.workers.trash: Creating trash for "/" failed - no permission?`
shows up in the terminal

EXPECTED RESULT
No output in the terminal

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 44
KDE Plasma Version: 6.6.5
KDE Frameworks Version: 6.26.0
Qt Version: 6.11.1

ADDITIONAL INFORMATION:
If I run 
QT_LOGGING_RULES="kf.kio.workers.*=true;kf.kio.core.copyjob=true" gwenview

I see the following output:
kf.kio.core.copyjob: CopyJob: stating the dest QUrl("trash:/")
kf.kio.core.copyjob: d->state= 1
kf.kio.core.copyjob: 
kf.kio.core.copyjob: dest is dir: true
kf.kio.workers.trash: fileSystemFreeSpace: QUrl("trash:/")
kf.kio.workers.trash: Creating trash for "/" failed - no permission?
kf.kio.core.copyjob: Couldn't determine free space information for
QUrl("trash:/")
kf.kio.core.copyjob: QUrl("file:///home/ponto/testdir/testfile.txt") ->
QUrl("trash:/testfile.txt") trying direct rename first
kf.kio.workers.trash: TrashProtocol::rename(): old=
QUrl("file:///home/ponto/testdir/testfile.txt")  new=
QUrl("trash:/testfile.txt")  overwrite= QFlags()
kf.kio.workers.trash: trashing a file
QUrl("file:///home/ponto/testdir/testfile.txt") QUrl("trash:/testfile.txt")
kf.kio.workers.trash: calling moveToTrash( "/home/ponto/testdir/testfile.txt"  
0   "testfile.txt" )
kf.kio.core.copyjob: d->state= 2
kf.kio.core.copyjob: Renaming succeeded, move on
kf.kio.core.copyjob: finalDestUrl= "trash:/0-testfile.txt"
kf.kio.core.copyjob: Setting m_dest to QUrl("trash:/")
kf.kio.core.copyjob: Stating finished. To copy: 0 , available:
18446744073709551615
kf.kio.core.copyjob: 
kf.kio.core.copyjob: copyNextFile finished
kf.kio.core.copyjob: KDirNotify'ing FilesAdded QUrl("trash:/")
kf.kio.core.copyjob: KDirNotify'ing FilesRemoved
QList(QUrl("file:///home/ponto/testdir/testfile.txt"))

The problem is that copyJob calls fileSystemFreeSpace with the url "trash:/". 
Here the path of the file to delete is lost and the Trash implementation has to
use the root filesystem to find the right trash.  As the check if
(mp->deviceId() == m_homeDevice) { in TrashImpl::findTrashDirectory fails due
to the different devices, the Trash implementation will not use my home
directory, even thoug the file is on the same device.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to