Merge pull request #351 from Scrumplex/fix-trash

This commit is contained in:
Sefa Eyeoglu 2022-10-31 22:56:07 +01:00
parent 7a5a4de6ea
commit 63a3dd1919
No known key found for this signature in database
GPG key ID: C10411294912A422
7 changed files with 27 additions and 24 deletions

View file

@ -44,6 +44,7 @@
#include <QStandardPaths>
#include <QTextStream>
#include <QUrl>
#include "DesktopServices.h"
#if defined Q_OS_WIN32
#include <objbase.h>
@ -228,6 +229,9 @@ bool trash(QString path, QString *pathInTrash = nullptr)
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
return false;
#else
// FIXME: Figure out trash in Flatpak. Qt seemingly doesn't use the Trash portal
if (DesktopServices::isFlatpak())
return false;
return QFile::moveToTrash(path, pathInTrash);
#endif
}