Details
Description
Qt 5.15 has a new function
QFile::moveToTrash()
This however uses wrong trash location on Ubuntu 20.04.
#include <QDebug> #include <QFile> int main() { QString fileName = "a.txt"; { QFile f(fileName); f.open(QFile::WriteOnly); } { QString trashFileName; QFile::moveToTrash(fileName, &trashFileName); qDebug() << trashFileName; } }
This moves the file to trash "/home/vlad/.Trash/files/". However when I use the default file manager in Ubuntu, this file manager uses path "/home/vlad/.local/share/Trash/files/". Which is where users of my application would expect the removed files to be. If there are multiple "correct" locations, it would be nice to be able to decide which one we want to use by Qt API.