Merge pull request #731 from flowln/windows_server_trash

This commit is contained in:
Sefa Eyeoglu 2023-01-11 09:49:20 +01:00 committed by GitHub
commit 219c5b323d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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