Merge pull request #731 from flowln/windows_server_trash

This commit is contained in:
Sefa Eyeoglu 2023-01-11 09:49:20 +01:00
parent a8611a56fc
commit 4539d58d7d
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951

View File

@ -56,6 +56,7 @@
#include <shlobj.h>
#include <shobjidl.h>
#include <sys/utime.h>
#include <versionhelpers.h>
#include <windows.h>
#include <winnls.h>
#include <string>
@ -234,6 +235,10 @@ bool trash(QString path, QString *pathInTrash = nullptr)
// FIXME: Figure out trash in Flatpak. Qt seemingly doesn't use the Trash portal
if (DesktopServices::isFlatpak())
return false;
#if defined Q_OS_WIN32
if (IsWindowsServer())
return false;
#endif
return QFile::moveToTrash(path, pathInTrash);
#endif
}